Compare commits

..
Author SHA1 Message Date
SlaveOfMagicbot 8a136d84f4 refactor: migrate JodaTime to java.time (rebuild on subdate2 ab96cfc)
Complete the JodaTime -> java.time migration across 30 files on the
correct subdate2 base. No org.joda references remain.
2026-10-09 20:12:23 -05:00
MagicBot ab96cfcda4 Header update 2026-07-26 19:08:44 -04:00
MagicBot ea5132bdf0 Message sent elsewhere 2026-07-26 18:54:20 -04:00
MagicBot a7c97297dd Guild resent after tol abandoned 2026-07-26 18:36:40 -04:00
MagicBot a42bdbd533 Nation dislodged if abandoned 2026-07-26 18:04:43 -04:00
MagicBot a67bd0d90b Nation dislodged if abandoned 2026-07-26 18:03:16 -04:00
MagicBot 6f54df62c4 Nation dislodged if abandoned 2026-07-26 17:56:45 -04:00
MagicBot f787416ca4 R8 deranked if abandoned 2026-07-26 17:20:53 -04:00
MagicBot 6a946428bf Better handling of abandoned tols 2026-07-26 17:13:01 -04:00
MagicBot 19e6c182c0 Better handling of abandoned tols 2026-07-26 17:02:01 -04:00
MagicBot 46045895d7 Realm count updated properly. 2026-07-26 16:38:01 -04:00
MagicBot 4a217d1a6b Warehouse record needs cleanup 2026-07-25 19:07:30 -04:00
MagicBot d624dd25dd Guild state not needed on login server. 2026-07-25 18:51:50 -04:00
MagicBot ba74ad3395 Nation is never null 2026-07-20 10:52:05 -04:00
MagicBot cb81a3093d Checking for landed subguilds when setting nation 2026-07-20 06:57:39 -04:00
MagicBot 586031e810 bugfix for toll not loaded when tested 2026-07-20 06:48:58 -04:00
MagicBot e0291590d7 Update to guild state handling 2026-07-20 06:35:00 -04:00
MagicBot e12ee2436e MAndrake resource hash updated. 2026-07-16 15:14:26 -04:00
MagicBot 012303ac54 state set properly after dismissing guilds. 2026-05-11 08:42:54 -04:00
MagicBot a057fac68c Comment added 2026-05-11 03:59:22 -04:00
MagicBot 3aca40dc78 Province qualifies as nation too. 2026-05-11 03:58:31 -04:00
MagicBot 5f67c043c2 Cleaner implementation 2026-05-11 03:51:21 -04:00
MagicBot 258bef5cb3 Cleaned up bad logic in helper 2026-05-10 21:38:38 -04:00
MagicBot 3f91ef7409 Debug logging added to bootstrap 2026-05-10 21:12:18 -04:00
MagicBot 57ab356a3a Cleanup of guildstate on boot 2026-05-10 20:44:52 -04:00
MagicBot f7249ba656 Logic cleanup pass for protectorate logic 2026-05-10 18:45:37 -04:00
MagicBot 24eb9608c3 Logic cleanup pass for protectorate logic 2026-05-10 18:36:43 -04:00
MagicBot e4096bebbd Formatting cleanup 2026-05-10 13:41:35 -04:00
MagicBot 547060b7a6 Errant nation 2026-05-10 13:40:46 -04:00
MagicBot ba6738d27a Errant nation 2026-05-10 13:39:26 -04:00
MagicBot 06c6468013 Errant nation 2026-05-10 13:37:42 -04:00
MagicBot 548796994f Sovereign as still having a city. 2026-05-10 13:36:31 -04:00
MagicBot 580452d68b Method removed 2026-05-10 12:10:51 -04:00
MagicBot a570d127be Formatting update 2026-05-10 12:08:48 -04:00
MagicBot a949a08e30 Method unused and removed 2026-05-10 12:07:15 -04:00
MagicBot 412f7f956f More state work 2026-05-10 12:06:32 -04:00
MagicBot aea6869ca0 State set properly upon dismissal 2026-05-10 12:01:09 -04:00
MagicBot 950523ddcc State set properly upon dismissal 2026-05-10 11:58:50 -04:00
MagicBot 631989e626 Guild state set previously 2026-05-10 11:49:51 -04:00
MagicBot 12f6d7574d Refactored out method 2026-05-10 11:40:06 -04:00
MagicBot 85dcad1c2a Only press button once. 2026-05-10 11:03:33 -04:00
MagicBot defa0d8bb8 Only press button once. 2026-05-10 11:03:07 -04:00
MagicBot 85872b66da Response message was not being displayed 2026-05-10 10:50:48 -04:00
MagicBot 09c9dfbc06 Inlines method. upgraded protection 2026-05-10 10:36:27 -04:00
MagicBot d014aafe45 Guild state set properly when breaking fealty 2026-05-10 10:32:57 -04:00
MagicBot d331093acd Not a nation until two landed guilds sub. 2026-05-10 10:18:15 -04:00
MagicBot 75ea9de4e5 Text to client updated with state 2026-05-10 10:12:13 -04:00
MagicBot 13207c16f6 Text to client updated with state 2026-05-10 10:06:37 -04:00
MagicBot b625ea2707 Text to client updated with state 2026-05-10 09:51:30 -04:00
MagicBot 6f752935ab Refactored out updatestate call. 2026-05-10 09:49:30 -04:00
MagicBot 49005c6647 State being set manually 2026-05-10 09:32:07 -04:00
FatBoy b2bd3b7a92 cancel on take mele damage 2026-02-03 11:51:29 -06:00
FatBoy 461e4e1c3d roollback extra effect cancel on damage 2026-02-03 11:45:47 -06:00
FatBoy 0d1d00e2d1 cancel on take damage for mele dnont flip damage t negatove 2026-02-03 11:33:13 -06:00
FatBoy ec6825d651 cancel on take damage for mele 2026-02-03 11:31:42 -06:00
FatBoy cb561c3b6b validity check for not looking up damage type that doesn't exist 2026-02-03 11:15:24 -06:00
MagicBot cf0f0cf022 Enumeration for server configs. 2026-01-23 11:45:28 -05:00
MagicBot f85673e661 Enumeration for server configs. 2026-01-18 10:08:53 -05:00
MagicBot 84347f8290 statAlt used as offset to terrain. 2026-01-13 14:56:06 -05:00
MagicBot fd2fe92714 Unused methods 2026-01-10 08:45:18 -05:00
MagicBot 955b94eb08 Minor method ordering change 2026-01-10 08:39:13 -05:00
MagicBot a9aa6e9660 Reminder to add power collections later 2026-01-09 13:40:10 -05:00
MagicBot afc080074f Enums needed to support parser. 2026-01-09 13:32:37 -05:00
MagicBot 1039fb1d0b Bonus code added to ConfigManager 2026-01-09 13:26:07 -05:00
MagicBot a955778eed Merge remote-tracking branch 'origin/magicbox-1.5.2.1' into magicbox-1.5.2.1 2026-01-09 13:16:26 -05:00
MagicBot 7717707518 wpak parser added to project 2026-01-09 13:12:40 -05:00
FatBoy 28836a7a4f log null blueprint in destroy city thread 2026-01-08 12:38:42 -06:00
FatBoy 5511dc7899 update lumber hash in mbEnums 2026-01-08 11:53:54 -06:00
FatBoy e5b2247204 disable teleports to cities that are destroyed or errant 2026-01-08 11:52:52 -06:00
FatBoy 0404ca1a94 Allow management of guild mines that are still active 2026-01-08 11:51:12 -06:00
MagicBot 9ad5f239b0 No modtable defaults to workorder. 2024-07-22 16:54:11 -04:00
MagicBot 3db8ee7afd Forge validation for modtables updated. 2024-07-22 16:37:27 -04:00
FatBoy f07974f673 dual wield spam attack issue resolved 2024-07-21 19:46:06 -05:00
FatBoy 0d5cef1652 guilds that have sub guilds can no longer be invited to join nations 2024-07-21 19:36:17 -05:00
FatBoy 04203c092a Lowering stats below item requirement unequips and removes item from map correctly 2024-07-21 19:32:16 -05:00
FatBoy 78feee482b items can now be equipped when skill level exactly meets item requirement 2024-07-21 19:23:34 -05:00
FatBoy 8c35844e08 Huntress pet cannot attack players resolved 2024-07-21 19:16:57 -05:00
FatBoy 0fbb43e021 proc fix 2024-07-12 13:43:28 -04:00
MagicBot 145449f26d Bronzewood mine_production updated. 2024-06-29 14:33:19 -04:00
FatBoy feef6263b4 cleanup 2024-06-27 20:41:43 -05:00
FatBoy 6c622c377f blocked power type structuring 2024-06-27 20:19:11 -05:00
FatBoy 8943121336 blocked power type structuring 2024-06-27 19:54:29 -05:00
FatBoy 70cb469190 final cleanup 2024-06-26 20:44:46 -05:00
FatBoy a42f307a70 immunitiy check compiled to single location 2024-06-26 20:37:28 -05:00
FatBoy 2a3ae6eaec Immunities refresh 2024-06-26 20:24:05 -05:00
FatBoy 9e4b596aa1 enforce KOS for building works 2024-06-26 20:07:37 -05:00
FatBoy aa1fe792a3 Load enforceKOS for buildings 2024-06-26 19:57:50 -05:00
FatBoy 79919121a8 claiming an errant ToL gives ownership to the leader of the guild, not individual player 2024-06-26 19:44:23 -05:00
FatBoy 80ccfff635 Building Management compiled to a single method check 2024-06-26 19:27:32 -05:00
MagicBot 381139af35 Collection of resourceHash 2024-06-26 12:31:08 -04:00
MagicBot e79da63556 Method cleanup. 2024-06-24 03:18:59 -04:00
MagicBot 533565e37e UUID is in keyset 2024-06-24 03:09:38 -04:00
FatBoy da0510d2bc proccing system 2024-06-22 19:50:53 -05:00
FatBoy 1f732a8ca9 failed rune sno longer get consumed 2024-06-22 19:31:13 -05:00
FatBoy 0d24789a93 reverse KOS function completed 2024-06-22 19:22:13 -05:00
FatBoy 35427cfb4a reverse KOS function 2024-06-22 19:04:04 -05:00
MagicBot 695a78b1e2 Noob island filter at 20 2024-06-19 17:57:28 -04:00
MagicBot 9f6710ccb9 More logic work 2024-06-19 17:51:42 -04:00
MagicBot fff1e80f61 More logic work 2024-06-19 17:49:46 -04:00
MagicBot 141af19daa More logic work 2024-06-19 17:38:44 -04:00
MagicBot 630748541f More logic work 2024-06-19 17:36:09 -04:00
MagicBot d32818f351 Rearrange logic 2024-06-19 17:27:04 -04:00
MagicBot d6f94bd0e7 Merged methods 2024-06-19 17:10:49 -04:00
MagicBot db6a4e471d Lore rules added to method 2024-06-19 17:08:56 -04:00
MagicBot a24c611bac Lore rules added to method 2024-06-19 17:01:02 -04:00
MagicBot 3926160ab1 Unused method removed 2024-06-19 16:56:57 -04:00
MagicBot 4a7013de61 Signature update 2024-06-19 16:56:06 -04:00
MagicBot 56564f1c3b Cleanup of teleport list 2024-06-19 16:53:55 -04:00
MagicBot 8a3e39e97d Cleanup of cityChoice handler 2024-06-19 15:05:01 -04:00
MagicBot 5224c79441 Condemned uuid is key not value in map 2024-06-19 14:53:57 -04:00
MagicBot ede016a93d Never null 2024-06-19 14:43:31 -04:00
MagicBot cc1825dec9 Increase to handle larger banks. 2024-06-18 12:43:59 -04:00
MagicBot d257ce50cf Sanity check for null city. 2024-06-18 11:56:19 -04:00
MagicBot 5b246211e1 Warehouse record removed in destruction banes. 2024-06-18 11:51:11 -04:00
FatBoy 33c923b0de fixed immunities in powers manager 2024-06-13 20:47:28 -05:00
FatBoy 02d524663a fixed a lore issue in powers manager 2024-06-13 20:14:43 -05:00
MagicBot 5bd85addb7 Removed count when validating stack withdraw weight. 2024-06-13 15:42:54 -04:00
FatBoy 40bae67443 fixed mob damage defense and ATR 2024-06-12 19:35:20 -05:00
FatBoy 1cf1d731c4 added = to range checks and converted speed to float 2024-06-12 19:23:34 -05:00
MagicBot 24215e21c9 Sanity check for deleted vendors 2024-06-12 14:15:19 -04:00
MagicBot 3accd779b9 Sanity check for deleted vendors 2024-06-12 14:06:18 -04:00
MagicBot 1d673ca2e5 Sanity check for deleted vendors 2024-06-12 14:04:19 -04:00
MagicBot c935ea1986 Project reformat. 2024-06-11 13:40:42 -04:00
MagicBot 678ccafd3c Unused variable removed. 2024-06-11 13:23:49 -04:00
MagicBot 31292785a5 templateHash used in this context. 2024-06-11 13:09:40 -04:00
MagicBot cdc4717033 Update to resources message 2024-06-11 12:54:57 -04:00
MagicBot 35c8ac0289 Update to resources message 2024-06-11 12:53:07 -04:00
MagicBot f5cc4a3290 Update to resource type 2024-06-10 15:19:57 -04:00
FatBoy 74bd7ddb8b attack speed calculation handled correctly 2024-05-31 19:02:59 -05:00
FatBoy 4feb95131c early exit for pets attacking a null target 2024-05-31 18:34:27 -05:00
FatBoy d22ba7b89d early exit for pets attacking a null target 2024-05-31 18:32:53 -05:00
FatBoy 722fd14be5 character should now play swing animation everytime he tried to swing regardless of early exits 2024-05-31 18:29:59 -05:00
FatBoy 12e73d59c7 apply weapon powers before early exit for defense of passives 2024-05-31 18:26:36 -05:00
FatBoy 5c70f15064 check player agro map for key before tryign to assign to it 2024-05-31 18:23:34 -05:00
MagicBot 8ca641f353 Return 0 for null table entry. 2024-05-31 07:41:25 -04:00
FatBoy 0f9500a0d7 swing animation for miss 2024-05-29 18:39:24 -05:00
FatBoy 0d51afb737 pet damage adjustment 2024-05-28 19:28:41 -05:00
FatBoy 60e331de1a animation work 2024-05-28 19:12:00 -05:00
FatBoy 4a554b0d61 animation work 2024-05-28 19:09:46 -05:00
FatBoy 3f3d85fb36 animation work 2024-05-28 18:55:54 -05:00
MagicBot d2d655a839 Null check for vendor workorder lookup. 2024-05-28 18:31:16 -04:00
FatBoy 0096b8051c updated range chack and hitbox calculations 2024-05-27 19:59:35 -05:00
FatBoy 86102c8933 updated range chack and hitbox calculations 2024-05-27 19:50:52 -05:00
FatBoy f06e2c2e5c traveller open gate fix 2024-05-26 22:36:12 -05:00
FatBoy 74b425e567 casting fix for lore rulesets 2024-05-26 22:20:30 -05:00
FatBoy 22c8cdcf65 fixed pet attack and null weapon combat issue 2024-05-26 22:00:52 -05:00
FatBoy 7ed026f088 machine gun combat fixed 2024-05-26 21:49:36 -05:00
FatBoy 232c381e96 early exit for attack timer 2024-05-26 21:41:59 -05:00
FatBoy 69ea460d5e early exit for attack timer 2024-05-26 20:31:22 -05:00
FatBoy cbe9a30590 corrected convention for naming auto attack job 2024-05-26 20:17:15 -05:00
FatBoy 1bbbc396bd handle destory or derank for buildings 2024-05-22 20:49:33 -05:00
FatBoy 8601f9fcd5 special animation case for Siege Bow 2024-05-22 19:52:21 -05:00
FatBoy 7f029fd0e2 invalid range check for ranged characters attacking a building 2024-05-22 19:45:16 -05:00
FatBoy cc7188b404 invalid range check for ranged characters attacking a building 2024-05-22 19:40:25 -05:00
FatBoy aa0621bb02 bane live processing with vulnerable buildings 2024-05-22 19:27:44 -05:00
FatBoy b4ff1a3f7f swing animation lookup 2024-05-17 20:34:26 -05:00
FatBoy 9d6b1dcf60 swing animation lookup 2024-05-17 20:22:56 -05:00
FatBoy 6e123ecb86 swing animation lookup 2024-05-17 20:17:17 -05:00
FatBoy 2b8b9464af swing animation lookup 2024-05-17 20:09:46 -05:00
FatBoy cd8099b42f noob island guard aggro 2024-05-17 20:01:39 -05:00
FatBoy 2cdcba47a5 noob island guard aggro 2024-05-17 19:57:18 -05:00
FatBoy b7b4623c75 noob island guard aggro 2024-05-17 19:53:39 -05:00
FatBoy 2d958b929d noob island guard aggro 2024-05-17 19:50:44 -05:00
FatBoy e8f0e9f5de noob island guard aggro 2024-05-17 19:50:09 -05:00
FatBoy 03f0f3fcf0 noob island guard aggro 2024-05-17 19:41:26 -05:00
FatBoy 65db64d3df null spam fix for hamlet guards 2024-05-16 19:41:06 -05:00
FatBoy 5a25958aa5 cannot teleport od repledge to perdition or bastion 2024-05-14 19:35:37 -05:00
FatBoy 1f8c5495ab repledge work 2024-05-14 19:28:19 -05:00
FatBoy a54aa03ade can always teleport and repledge to your own nation 2024-05-14 19:22:31 -05:00
FatBoy e82445fcd2 teleport and repledge inside your own nation 2024-05-14 19:14:40 -05:00
FatBoy 9e9716fc88 Lore Teleport list and repledge list construction 2024-05-14 19:10:01 -05:00
FatBoy 4f01da368c Lore Guard AI Aggro 2024-05-14 18:49:30 -05:00
FatBoy 93c4103f61 Lore Mob AI Aggro 2024-05-14 18:42:38 -05:00
MagicBot f8180a7000 Removed custom exception candy 2024-05-12 13:42:11 -04:00
MagicBot 634f1478ce Removed custom exception candy 2024-05-12 13:36:47 -04:00
MagicBot 7335946c10 Removed 4 squigglies 2024-05-12 13:31:05 -04:00
MagicBot fb4eea67ed Comment cleanup 2024-05-12 13:18:51 -04:00
MagicBot 96ba17f67a DispatchManager is now an official manager singleton. 2024-05-12 13:14:42 -04:00
MagicBot ff17cacda7 magicvalue update 2024-05-12 12:54:11 -04:00
MagicBot 4d6ce2b155 Update to value in item rs constructor 2024-05-12 12:06:30 -04:00
MagicBot b2c9331899 Unused variables removed 2024-05-12 11:57:26 -04:00
MagicBot 1cb01b1cce Unused field removed 2024-05-12 11:55:12 -04:00
MagicBot e79fd0c3b4 Unused method removed 2024-05-12 11:46:28 -04:00
MagicBot 6dd1d97be5 Comment cleanup 2024-05-12 11:34:22 -04:00
MagicBot 805034e30b Comment cleanup 2024-05-12 11:32:00 -04:00
MagicBot 9646964698 TODO touchup 2024-05-12 11:31:25 -04:00
MagicBot 9ffaf96017 recalc magic value 2024-05-12 11:24:01 -04:00
MagicBot ce98f80b85 recalc magic value 2024-05-12 11:22:12 -04:00
MagicBot f683201086 recalc magic value 2024-05-12 11:18:22 -04:00
MagicBot 4796f7042d Bugfix in update_value 2024-05-12 11:09:45 -04:00
MagicBot 94ff3cf222 New rolling duration method moved to manager singleton. 2024-05-12 08:14:06 -04:00
MagicBot 174be35cac Comment cleanup 2024-05-12 07:17:31 -04:00
MagicBot ba266e506a Comment cleanup 2024-05-12 07:15:55 -04:00
MagicBot 4123157b92 Comment cleanup 2024-05-11 13:12:10 -04:00
MagicBot 7bb9aeacf7 Comment cleanup 2024-05-11 11:06:07 -04:00
MagicBot 1eda55a3f1 Serialization update 2024-05-11 11:01:49 -04:00
MagicBot f670e3143c Serialization update 2024-05-11 10:52:31 -04:00
MagicBot d55b57f7d0 Flag testing 2024-05-11 10:46:34 -04:00
MagicBot ea2f6f4593 Remove from dbManager cache 2024-05-11 09:37:23 -04:00
MagicBot b592f050c2 convention is == false 2024-05-11 09:33:54 -04:00
MagicBot 25f522c539 Make sure no memory leaks 2024-05-11 09:25:57 -04:00
MagicBot e89404abda json and string methods updated 2024-05-11 09:19:29 -04:00
MagicBot ad2cde9d85 Atomic instead of volatile to match counter 2024-05-11 09:16:48 -04:00
MagicBot ba94fabfb8 Atomic instead of volatile to match counter 2024-05-11 09:15:11 -04:00
MagicBot f7ab38e9a8 Comment updated 2024-05-11 09:02:54 -04:00
MagicBot 0d97fa614b Equals and hash overrides for workObject 2024-05-11 08:57:26 -04:00
MagicBot 6878916874 Update to workOrder cleanup 2024-05-11 08:51:41 -04:00
MagicBot c545468f26 Update to workOrder cleanup 2024-05-11 08:49:44 -04:00
MagicBot 7993fb22d2 Thread consistency for these 2024-05-11 08:33:34 -04:00
MagicBot 19bdb89c0f Unused variable removed 2024-05-11 08:30:32 -04:00
MagicBot 6b0b0cc357 Workorder set to completed when redeeding. 2024-05-11 08:07:04 -04:00
MagicBot bc1ae9a2c9 Minor cleanup 2024-05-11 08:02:19 -04:00
MagicBot 408e3a45ca Workorders cleared with hireling removal. 2024-05-11 07:51:56 -04:00
MagicBot 52e0b5be4d Minor cleanup 2024-05-11 07:31:09 -04:00
MagicBot 161335da26 Comment cleanup 2024-05-10 10:12:45 -04:00
MagicBot 7f1bc2a4b7 Update to workOrder loading. 2024-05-10 09:50:14 -04:00
MagicBot e37a4fab38 Update to workOrder loading. 2024-05-10 09:44:11 -04:00
MagicBot 2760a45d2f Early exit moved to run() 2024-05-10 09:39:43 -04:00
MagicBot 77673fde5f completed workOrders handling update 2024-05-10 09:34:58 -04:00
MagicBot 5fd4e5a088 Early exit for no avail slots 2024-05-09 14:50:47 -04:00
MagicBot b01b62ac3d Withdraw logic cleanup 2024-05-09 14:40:40 -04:00
MagicBot 7193ff7698 Withdraw logic cleanup 2024-05-09 14:12:55 -04:00
MagicBot dd72e20ff9 Withdraw logic cleanup 2024-05-09 14:04:19 -04:00
MagicBot f465ea4045 Withdraw logic cleanup 2024-05-09 11:32:26 -04:00
MagicBot 973dfc94f7 Withdraw logic cleanup 2024-05-09 11:31:12 -04:00
MagicBot a5255bcf11 Simplify total cost calc 2024-05-08 15:40:35 -04:00
MagicBot ec35228de9 Beardstyle bugfix 2024-05-08 13:31:47 -04:00
MagicBot 47a93f6545 sql parm count fix 2024-05-06 13:56:18 -04:00
MagicBot 0cff40070b Realm derived not stored 2024-05-06 13:33:28 -04:00
FatBoy 3f3fb53675 hamlet guard aggro 2024-05-05 19:45:46 -05:00
FatBoy b198dbcc09 Added ./setrace command 2024-05-04 21:39:35 -05:00
FatBoy 60b8843563 Added ./setrace command 2024-05-04 21:38:06 -05:00
MagicBot eff8be91d6 Comment cleanup 2024-05-04 13:38:38 -04:00
MagicBot 55e2d3fb5e Class cleanup 2024-05-04 13:33:33 -04:00
MagicBot a6f417d9cc Comment cleanup 2024-05-04 13:23:33 -04:00
MagicBot 7b1b09dc40 Comment cleanup 2024-05-04 13:20:26 -04:00
MagicBot 5724608005 Class cleanup 2024-05-04 13:18:34 -04:00
MagicBot f5d410f868 typo fixed contextually 2024-05-04 12:58:46 -04:00
MagicBot a5c1422534 unused variable removed 2024-05-04 12:55:51 -04:00
MagicBot 6df0e5625c Class cleanup. 2024-05-04 12:53:06 -04:00
MagicBot 5de932b095 Comment updated. 2024-05-04 12:41:45 -04:00
MagicBot db7d606b36 Devcmd removed. 2024-05-04 12:31:25 -04:00
FatBoy 30d302c43e Lore Guards use charter restrictions when aggroing 2024-04-30 21:45:28 -05:00
FatBoy 95cfc43956 debug option added in canJoin for charter type 2024-04-28 13:49:14 -05:00
FatBoy 7c8d78581e debug option added in canJoin for charter type 2024-04-28 13:46:35 -05:00
FatBoy 6f4a9f7d1a debug option added in canJoin for charter type 2024-04-28 13:44:35 -05:00
FatBoy 7a5569ab89 return guild charter type 2024-04-28 13:39:24 -05:00
FatBoy 042f7c675f cleanup dbEffectsResourceCostHandler 2024-04-28 13:28:53 -05:00
MagicBot 3c4d8239db Charter template id is stored not ordinal 2024-04-28 14:18:13 -04:00
MagicBot 4f20cc9aba Comment update. 2024-04-28 13:56:03 -04:00
MagicBot 34812694b7 Comparison fix 2024-04-28 13:49:21 -04:00
MagicBot 0bbbcbaa81 Removed squiggles 2024-04-28 13:44:35 -04:00
FatBoy 72172b9f05 GuildType lookup work 2024-04-28 12:40:53 -05:00
MagicBot 1876e09b48 method for populating lookup table 2024-04-28 13:34:45 -04:00
MagicBot 31c83f2bb5 upgraded protection for variables 2024-04-28 13:26:07 -04:00
MagicBot 065aa34652 Update to type constructor 2024-04-28 13:23:52 -04:00
FatBoy 8bbaae418d fix for player guild checks 2024-04-28 12:05:56 -05:00
FatBoy 10db850de4 replace == "LORE" with .equals("LORE") 2024-04-28 11:58:55 -05:00
FatBoy 753c3686ea Added MB Dev Notes 2024-04-28 11:44:28 -05:00
FatBoy f4bd928796 Lore check for telport and repledge 2024-04-28 11:34:03 -05:00
MagicBot 916a12a434 City realm id lookup not db load 2024-04-27 11:32:05 -04:00
MagicBot 3a8521683b Bootstrap logging info update 2024-04-27 09:32:25 -04:00
MagicBot df4d5a654f Comment cleanup 2024-04-27 08:58:28 -04:00
MagicBot 7fb5d7d23d Comment cleanup 2024-04-27 08:53:50 -04:00
MagicBot a7c9a15405 Comment cleanup 2024-04-27 08:47:04 -04:00
MagicBot b3b115e9ba Comment cleanup 2024-04-27 08:37:20 -04:00
MagicBot 1b5a64d8fc Minor cleanup 2024-04-27 08:17:43 -04:00
MagicBot 01f0e25e08 Minor cleanup 2024-04-27 08:17:17 -04:00
MagicBot 0782814c8e Update to junk handling 2024-04-27 08:14:31 -04:00
MagicBot 111ba02289 Merge remote-tracking branch 'refs/remotes/origin/feature-workorder2.8' into magicbox-1.5.2.1 2024-04-27 07:28:55 -04:00
MagicBot f09a7d4d12 Unused method removed 2024-04-27 07:27:03 -04:00
MagicBot e1e72b71bd Better name for context 2024-04-27 07:24:57 -04:00
MagicBot 4dce2e2aa2 Comment cleanup 2024-04-27 07:22:20 -04:00
MagicBot 743c897254 total_to_produce updated when slot removed from workOrder 2024-04-27 07:18:24 -04:00
MagicBot f134f71695 Squiggly removal 2024-04-27 07:07:59 -04:00
MagicBot 91016dd53c Cleanup in bane handling 2024-04-27 07:06:39 -04:00
FatBoy 39d04188b4 cleanup old rune handler in ObjectActionMsgHandler 2024-04-26 19:10:56 -05:00
FatBoy c99433c9bd missing case for type RUNE in ObjectActionMsgHandler 2024-04-26 19:07:33 -05:00
FatBoy 6cc94e076d promoting was attempting to use players promotion class (which is null) 2024-04-26 19:00:12 -05:00
MagicBot f294e48140 Null check added for city 2024-04-26 16:15:16 -04:00
MagicBot c25f325f87 Null check added for city 2024-04-26 16:15:07 -04:00
MagicBot ac0c11cb46 Comment cleanup 2024-04-26 15:56:04 -04:00
MagicBot 79e86e0a6f Comment cleanup 2024-04-26 15:43:45 -04:00
MagicBot 46f35f0b10 Minor update to keyset() usages 2024-04-26 15:37:37 -04:00
MagicBot 1b20201f8d MB Dev note added 2024-04-26 15:32:17 -04:00
MagicBot 0d744d900c MB Dev note added 2024-04-26 15:12:53 -04:00
MagicBot 9a8e0bd5c9 Comment cleanup 2024-04-26 15:10:49 -04:00
MagicBot 6b6be80fa8 Comment cleanup 2024-04-26 15:02:19 -04:00
MagicBot c2152432ce Comment cleanup 2024-04-26 15:00:03 -04:00
MagicBot 9348852e2c Comment cleanup 2024-04-26 14:57:02 -04:00
MagicBot 4b67f97ded MB Dev Notes added 2024-04-26 08:21:15 -04:00
MagicBot 2a9463be4e camelCase 2024-04-26 08:14:16 -04:00
MagicBot 67bc13dcde MB Dev Notes added to critical classes. 2024-04-26 08:09:07 -04:00
MagicBot 7d6407fbf5 comment cleanup 2024-04-25 20:26:13 -04:00
MagicBot 7b6f5f752b comment cleanup 2024-04-25 20:25:16 -04:00
MagicBot ef43211103 comment cleanup 2024-04-25 20:24:15 -04:00
MagicBot b312904548 comment cleanup 2024-04-25 20:22:55 -04:00
MagicBot 3b1db51a5e comment cleanup 2024-04-25 20:22:29 -04:00
MagicBot 17011de201 comment cleanup 2024-04-25 19:59:15 -04:00
MagicBot f03edf5c5d comment cleanup 2024-04-25 19:57:56 -04:00
MagicBot 320f06e1db comment cleanup 2024-04-25 10:08:27 -04:00
MagicBot 78480ca3dd comment cleanup 2024-04-25 10:06:55 -04:00
MagicBot 2e5f8701df comment cleanup 2024-04-25 10:04:58 -04:00
MagicBot 3a514dc771 comment cleanup 2024-04-25 10:03:37 -04:00
MagicBot c0b93ff809 comment cleanup 2024-04-25 09:51:34 -04:00
MagicBot 31037c9324 comment cleanup 2024-04-25 09:47:58 -04:00
MagicBot 2464deb3f3 comment cleanup 2024-04-25 09:41:02 -04:00
MagicBot dbf42bfbef json fix in constructor 2024-04-25 09:39:03 -04:00
MagicBot e80cdc192d Update to withdraw calc 2024-04-25 09:33:47 -04:00
MagicBot 9850b54981 Comment cleanup 2024-04-25 09:22:50 -04:00
MagicBot a3a30f3f8a Comment cleanup 2024-04-25 09:02:52 -04:00
MagicBot 4d0018b176 Comment cleanup 2024-04-25 08:51:33 -04:00
MagicBot a9dcac0ad7 Comment cleanup 2024-04-25 08:49:59 -04:00
MagicBot adaa521bf5 Comment cleanup 2024-04-25 08:49:13 -04:00
MagicBot 0fe04041f6 Workorder method moved to workorder 2024-04-25 08:42:20 -04:00
MagicBot 9dd2e1d5e5 Comment cleanup 2024-04-25 08:41:23 -04:00
MagicBot 81d6054982 Debit building first then warehouse 2024-04-25 07:44:19 -04:00
MagicBot ff2e381999 Update to validation order. 2024-04-24 13:47:25 -04:00
MagicBot e1d43ce0d0 Expand scope of try block. 2024-04-24 13:44:22 -04:00
MagicBot a906e30931 Setting containertype. 2024-04-24 13:36:32 -04:00
MagicBot 6a17f93e41 Setting containertype. 2024-04-24 13:13:48 -04:00
MagicBot 1edd4d681b Update to protection check. 2024-04-23 15:14:43 -04:00
MagicBot 911698a7e3 Method moved to WorkOrder 2024-04-23 15:11:56 -04:00
MagicBot 4fa646ce94 New costmap data implemented 2024-04-23 15:05:03 -04:00
MagicBot bcb40fecbb Loading effect costmap data at bootsrap 2024-04-23 14:56:30 -04:00
MagicBot 147b9a42c4 Costmap data generated; removed from bootstrap 2024-04-23 14:41:34 -04:00
MagicBot 81f86ceca9 Code written to refactor db call out of effect costs. 2024-04-23 14:36:01 -04:00
MagicBot e2dbc19adc Code written to refactor db call out of effect costs. 2024-04-23 14:31:08 -04:00
MagicBot d590511035 Code written to refactor db call out of effect costs. 2024-04-23 14:27:12 -04:00
MagicBot f48b9f10e1 Code written to refactor db call out of effect costs. 2024-04-23 14:25:19 -04:00
MagicBot 2607962038 Minor cleanup 2024-04-23 13:40:51 -04:00
MagicBot 4e05c2ab74 Warehouse debit work 2024-04-23 13:38:35 -04:00
MagicBot 6cbcef00aa Serialization update 2024-04-23 13:27:01 -04:00
MagicBot a76fd9f319 Update to identify assignment 2024-04-23 13:20:34 -04:00
MagicBot 8d7d3227cb Update to submit logging 2024-04-23 13:15:15 -04:00
MagicBot 9102fe1f6c Update to single item rolling config 2024-04-23 13:12:49 -04:00
MagicBot d999d00755 Rebuild of ./createitem 2024-04-23 12:42:12 -04:00
MagicBot a7e953ac20 Rebuild of ./createitem 2024-04-23 12:41:10 -04:00
MagicBot 46b4c110e5 Rebuild of ./createitem 2024-04-23 12:38:49 -04:00
MagicBot 30787f7ae2 Remnants of old garbage system removed 2024-04-23 12:25:26 -04:00
MagicBot 9de1afa0fd Comment update 2024-04-23 12:15:26 -04:00
MagicBot 9efba13b03 Simplified lambda function 2024-04-23 12:14:31 -04:00
MagicBot d7ac838b6d Simplified lambda function 2024-04-23 12:11:04 -04:00
MagicBot 50a169149f Resubmit unfinished workorders 2024-04-22 16:33:29 -04:00
MagicBot de65f6bcef Bugfix in pre/suf parsing 2024-04-22 16:28:02 -04:00
MagicBot 2adaff8f66 workOrderID added to output 2024-04-22 16:21:00 -04:00
MagicBot e8032f65d1 Loading workorders at bootstrap 2024-04-22 16:14:10 -04:00
MagicBot e710cf0930 Loading workorders at bootstrap 2024-04-22 16:12:26 -04:00
MagicBot 286a76b1de More workorder loading work 2024-04-22 16:07:25 -04:00
MagicBot 73e30062ea Method to load workorders on bootstrap 2024-04-22 16:02:22 -04:00
MagicBot 7300af9073 Method to load workorders on bootstrap 2024-04-22 15:49:57 -04:00
MagicBot 2a2b61bc0f Method to load workorders on bootstrap 2024-04-22 15:43:13 -04:00
MagicBot 89c3eb4d47 New workorder constructor 2024-04-22 15:34:57 -04:00
MagicBot c03f464043 More workorder db work 2024-04-22 15:12:46 -04:00
MagicBot 7b7492b5cc Workokrders updates as they cycle 2024-04-22 15:09:43 -04:00
MagicBot 684a5459b3 Worker saved upon submit 2024-04-22 15:02:15 -04:00
MagicBot bb5904552a Worker saved upon submit 2024-04-22 14:57:00 -04:00
MagicBot fb9d65b54d Method to save workorders to disk created 2024-04-22 14:55:46 -04:00
MagicBot a53848334f id is key not saved in json 2024-04-22 14:47:42 -04:00
MagicBot 19c6cd76a9 Warehouse updated for org.json 2024-04-22 13:43:22 -04:00
MagicBot d92b1c7473 Helpee and groupee parsing 2024-04-22 13:38:04 -04:00
MagicBot 07a5de2c57 Helpee and groupee parsing 2024-04-22 13:33:03 -04:00
MagicBot d0a837783e Update to sparsetype parsing 2024-04-22 13:23:18 -04:00
MagicBot 576f4af433 Update to sparsetype parsing 2024-04-22 13:18:41 -04:00
MagicBot 8ce81b144a Update to sparsetype parsing 2024-04-22 13:01:25 -04:00
MagicBot fcbb9b0cf1 Update to sparsetype parsing 2024-04-22 12:56:01 -04:00
MagicBot 4f115291eb No some are longs 2024-04-22 12:50:45 -04:00
MagicBot 79079e200a Bitvectors use int not long for mb 2024-04-22 12:48:03 -04:00
MagicBot dbab8f66da Migration to org.json 2024-04-22 12:42:52 -04:00
MagicBot 1d847d781b Migration to org.json 2024-04-22 12:34:57 -04:00
MagicBot 7604b7b07f Migration to org.json 2024-04-22 12:20:53 -04:00
MagicBot 8818282341 Migration to org.json 2024-04-22 11:49:41 -04:00
MagicBot 475ccaff0c Migration to org.json 2024-04-22 09:32:20 -04:00
MagicBot ba47b30673 Migration to org.json 2024-04-22 09:21:46 -04:00
MagicBot d557e30716 Workorder to json work 2024-04-22 08:57:02 -04:00
MagicBot 6499a16cc2 Workorder to json work 2024-04-22 08:53:33 -04:00
MagicBot a851d9a6ec Workorder to json work 2024-04-22 08:40:20 -04:00
MagicBot c09ae5d32f Workorder to json work 2024-04-22 08:35:58 -04:00
MagicBot 27d140f703 Junk or completion removes slot from workOrder 2024-04-22 08:28:43 -04:00
MagicBot 41aefa4a48 Comment cleanup 2024-04-22 08:20:02 -04:00
MagicBot 4723eb4bf2 Serialization update. 2024-04-22 07:56:25 -04:00
MagicBot 28c6953c3d Serialization update. 2024-04-22 07:54:03 -04:00
MagicBot 746a95e7d5 Overflow calc updated 2024-04-22 07:44:47 -04:00
MagicBot 0e7336b8c6 Concurrency update 2024-04-22 07:35:59 -04:00
MagicBot 11013bcd07 Reformat for easier debugging 2024-04-22 01:13:26 -04:00
MagicBot 63c7fb08e0 Concurrency update 2024-04-22 00:46:59 -04:00
MagicBot 6f39767fb4 Concurrency update 2024-04-22 00:37:49 -04:00
MagicBot 2de1f78f22 Slot tracking update 2024-04-22 00:25:16 -04:00
MagicBot 98b73d978a Slot tracking update 2024-04-22 00:19:29 -04:00
MagicBot 5a62361edd Slot tracking update 2024-04-22 00:10:32 -04:00
MagicBot 127f80054f Slot tracking update 2024-04-22 00:03:03 -04:00
FatBoy 41b1718df1 use delay for attacks for players 2024-04-21 13:19:50 -05:00
MagicBot d3b1cf9928 Comment update 2024-04-21 14:10:35 -04:00
MagicBot 7f8c297ae2 City check moved outside of validation 2024-04-21 14:08:27 -04:00
FatBoy 979cd70d65 update class type when promoting 2024-04-21 13:04:47 -05:00
FatBoy 35945f7542 equipping bug 2024-04-21 12:53:38 -05:00
FatBoy 84233ecdd6 use of proper animations 2024-04-21 12:43:23 -05:00
FatBoy 4d601f13a0 Merge remote-tracking branch 'origin/feature-workorder2.7' into feature-workorder2.7 2024-04-21 12:22:02 -05:00
FatBoy 1911de0757 random animation for weapon powers 2024-04-21 12:21:34 -05:00
MagicBot e00871324e Float fix 2024-04-21 13:21:00 -04:00
MagicBot 0286b63a8e Class reformat 2024-04-21 12:56:41 -04:00
FatBoy a84c712110 random animation for weapon powers 2024-04-21 11:52:47 -05:00
FatBoy 8e93e82526 random animation for weapon powers 2024-04-21 11:50:04 -05:00
FatBoy 67bf8c2b11 animation combat cleanup 2024-04-21 11:46:45 -05:00
FatBoy b8dbcb62db early exit for combat cycle 2024-04-21 11:21:40 -05:00
FatBoy bb5d257ae8 early exit for out of stam when attacking 2024-04-21 11:14:10 -05:00
MagicBot 2391bd6606 Unused method removed 2024-04-21 11:54:17 -04:00
MagicBot dc83bee227 File reformat 2024-04-21 11:40:27 -04:00
MagicBot 3ff7414fb4 Rework of item forge method collection usage 2024-04-21 11:39:59 -04:00
MagicBot 1e5790e6b9 Rework of item forge method collection usage 2024-04-21 08:23:58 -04:00
MagicBot 364fb40e0b junk, complete and produce wrapped with same lock as warehouse. 2024-04-20 16:52:24 -04:00
MagicBot 6a72a83076 Must be in a building and in city 2024-04-20 16:22:22 -04:00
MagicBot a83008ea4f Removed bypass in prep for db load. 2024-04-20 16:00:58 -04:00
MagicBot 89f672e0b0 json constructor for workOrders 2024-04-20 15:58:01 -04:00
MagicBot cc324777d1 Warehouse withdraws are persisted 2024-04-20 15:54:31 -04:00
MagicBot 692e7ec416 Comment cleanup 2024-04-20 13:35:04 -04:00
MagicBot 6cba850af5 Class cleanup and comment fixes 2024-04-20 13:26:44 -04:00
MagicBot f3e266cf46 Class cleanup 2024-04-20 13:21:53 -04:00
MagicBot ac347db0c8 debitWorkOrderCost method created 2024-04-20 13:05:19 -04:00
MagicBot 70e6756651 debitWorkOrderCost method created 2024-04-20 13:01:21 -04:00
MagicBot a46205b67b Uses mainline cache for virtual items 2024-04-20 12:45:05 -04:00
MagicBot 80aa413ea8 Methods moved to itemmanger 2024-04-20 12:37:55 -04:00
MagicBot 98d03620bc Persisting effects in complete item 2024-04-20 12:33:55 -04:00
MagicBot cca4521c93 Item prefix and suffix applied 2024-04-20 12:28:30 -04:00
MagicBot a859150a20 Item prefix and suffix applied 2024-04-20 12:17:37 -04:00
MagicBot d64bd193d8 Item prefix and suffix applied 2024-04-20 12:13:33 -04:00
MagicBot d0df406236 Item prefix and suffix applied 2024-04-20 11:53:53 -04:00
MagicBot 92c8430031 Item prefix and suffix applied 2024-04-20 11:13:31 -04:00
MagicBot 99671697ba Item prefix and suffix applied 2024-04-20 11:05:30 -04:00
MagicBot 171c79dcf6 Item prefix and suffix applied 2024-04-20 11:02:35 -04:00
MagicBot 726d471e95 Item prefix and suffix applied 2024-04-20 10:57:51 -04:00
MagicBot c0ed59f14f Item prefix and suffix applied 2024-04-20 10:43:39 -04:00
MagicBot c19c516669 Item prefix and suffix applied 2024-04-20 10:39:45 -04:00
MagicBot 589ea1bce8 Item prefix and suffix applied 2024-04-20 10:26:21 -04:00
MagicBot c133b2da5c Item prefix and suffix applied 2024-04-20 10:20:02 -04:00
MagicBot 24a05543c8 Item prefix and suffix applied 2024-04-20 10:11:56 -04:00
MagicBot 90271890d7 Item prefix and suffix applied 2024-04-20 09:59:04 -04:00
MagicBot 225dc2af18 Item prefix and suffix applied 2024-04-20 09:42:48 -04:00
MagicBot 501c68b1e3 Item prefix and suffix applied 2024-04-20 09:34:49 -04:00
MagicBot 13a75fcd5d Item prefix and suffix applied 2024-04-20 09:10:31 -04:00
MagicBot 1bc3609cbe Unused method removed 2024-04-20 08:57:42 -04:00
MagicBot 2c87e48178 Work on adding modifiers 2024-04-20 08:55:04 -04:00
MagicBot ac10b78d68 Work on adding modifiers 2024-04-20 08:54:28 -04:00
MagicBot 4549688ad7 Update to modifier returned 2024-04-20 08:43:12 -04:00
MagicBot 0a6e40eb74 removed for testing 2024-04-19 10:55:07 -04:00
MagicBot b1b635380a Completed items are identified 2024-04-19 10:49:19 -04:00
MagicBot 7309fdc62f Method moved to Warehouse 2024-04-19 10:46:31 -04:00
MagicBot 412ef0f642 Do not remove until complete pressed 2024-04-19 10:45:28 -04:00
MagicBot 3071cb5847 Apply effects to item 2024-04-19 10:40:03 -04:00
MagicBot 1a7f63ce05 lastNegativeId moved to ItemManager 2024-04-19 10:32:36 -04:00
MagicBot c03c1f4057 Update to item effect serialization 2024-04-19 10:11:27 -04:00
MagicBot 264094924b Proper accounting for workOrder removal post completion 2024-04-19 09:50:29 -04:00
MagicBot 0ec2b436de Window refresh update 2024-04-19 09:38:01 -04:00
MagicBot f36239a67e Window refresh update 2024-04-19 09:30:59 -04:00
MagicBot b673ca9636 Window refresh update 2024-04-19 09:27:50 -04:00
MagicBot cba7ee4066 Window refresh update 2024-04-19 09:23:34 -04:00
MagicBot 0f2b46b898 Window refresh update 2024-04-19 09:20:01 -04:00
MagicBot d76b670b75 Window refresh update 2024-04-19 09:18:30 -04:00
MagicBot ca71079106 Window refresh update 2024-04-19 09:16:38 -04:00
MagicBot adf686974d Window refresh update 2024-04-19 09:16:01 -04:00
MagicBot 6ecaa4dc0c Window refresh update 2024-04-19 09:07:49 -04:00
MagicBot c1939075cd Window refresh update 2024-04-19 09:07:23 -04:00
MagicBot 18587e281f refactored out collection 2024-04-19 09:03:35 -04:00
MagicBot dbd4c5d246 Method added to replace collection 2024-04-19 08:59:10 -04:00
MagicBot 919b29c38f Deduct cost from warehouse 2024-04-19 08:15:17 -04:00
MagicBot 01113fc3a6 Configure before setting cost 2024-04-17 14:24:05 -04:00
MagicBot b9627e1643 Class cleanup 2024-04-17 14:15:12 -04:00
MagicBot e6d83ca36c Mobloot vestiges removed 2024-04-17 14:07:42 -04:00
MagicBot a522eeb823 Update to completion 2024-04-17 13:59:34 -04:00
MagicBot 8d1561cd29 Update to completion 2024-04-17 13:58:25 -04:00
MagicBot d7ba42f4da Update to batch completion 2024-04-17 13:48:39 -04:00
MagicBot 689fc142d0 Persisted items belong in vendor inventory not virtual ones. 2024-04-17 13:46:10 -04:00
MagicBot 8df0c838cc More completion work 2024-04-17 12:47:28 -04:00
MagicBot f9825900cc More completion work 2024-04-17 12:36:23 -04:00
MagicBot 1a27a54926 Not right place for this perhaps 2024-04-17 12:24:17 -04:00
MagicBot 1e003c28ab Completion work 2024-04-17 12:20:45 -04:00
MagicBot 8cada05424 Completion time reset before new batch 2024-04-17 12:04:41 -04:00
MagicBot dda98318eb Work on virtual item handling 2024-04-17 11:56:23 -04:00
MagicBot 6e95ae5245 Variable naming update 2024-04-16 16:01:17 -04:00
MagicBot a4a9a26ac4 Complete is complete 2024-04-16 15:53:13 -04:00
MagicBot 93aec63f78 File reformat 2024-04-16 15:40:10 -04:00
MagicBot 9804a0fc89 Debug strings were removed 2024-04-16 15:35:55 -04:00
MagicBot 3484802a24 Comment cleanup 2024-04-16 15:34:39 -04:00
MagicBot 946a150db1 Comment cleanup 2024-04-16 15:34:14 -04:00
MagicBot 197df90a21 Comment cleanup 2024-04-16 15:33:39 -04:00
MagicBot a944f7342a All rolls treated equally 2024-04-16 15:17:15 -04:00
MagicBot 7c855afbe7 All runs set to complete 2024-04-16 15:11:03 -04:00
MagicBot d42bc3520d Single runs are set to complete. Multiple item runs are dumped to inventory. 2024-04-16 15:03:59 -04:00
MagicBot a86d90ef41 serialization work 2024-04-16 14:55:03 -04:00
MagicBot c5dfb3ad81 Serialization work 2024-04-16 14:47:35 -04:00
MagicBot e879c588dc More window work. 2024-04-16 14:21:29 -04:00
MagicBot 862e75cd4c Serialization updated. Collection adds slot. 2024-04-16 14:01:46 -04:00
MagicBot d47643e730 Error logging added 2024-04-15 15:48:15 -04:00
MagicBot 0727361933 More window work 2024-04-15 15:29:13 -04:00
MagicBot c1b0bcedf4 Remove workorder when completed 2024-04-15 15:22:11 -04:00
MagicBot 315c2abfb9 Remove workorder when completed 2024-04-15 15:15:08 -04:00
MagicBot b0c0c507e5 More window work 2024-04-15 14:59:07 -04:00
MagicBot 12b6e41432 Fixing Junk functionality 2024-04-15 14:45:34 -04:00
MagicBot a2484f94eb Bugfix in forge contains 2024-04-15 14:33:33 -04:00
MagicBot b4824c69b8 Window work 2024-04-15 14:24:50 -04:00
MagicBot 03fb180f02 Set variable on submit 2024-04-15 12:49:37 -04:00
MagicBot 250afe3bba Serialization update 2024-04-15 12:41:05 -04:00
MagicBot b80b3a81b5 Message sent early 2024-04-15 12:34:35 -04:00
MagicBot cd8b910262 Clear collections last 2024-04-15 12:31:16 -04:00
MagicBot d007850afe Clear collections last 2024-04-15 12:23:46 -04:00
MagicBot 7f3873b63f fail fast on null 2024-04-15 12:23:01 -04:00
MagicBot 963df074a4 More persist work 2024-04-15 12:17:57 -04:00
MagicBot 5505d7bc61 Items are persisted and moved to vendor inventory 2024-04-15 12:12:40 -04:00
MagicBot 0c9ec31fa3 Window serialization work 2024-04-15 11:53:24 -04:00
MagicBot d71c65702d Window serialization work 2024-04-15 11:49:42 -04:00
MagicBot a4af39cab7 Window serialization work 2024-04-15 11:45:38 -04:00
MagicBot 9ba697c310 Persist item work 2024-04-15 11:30:56 -04:00
MagicBot 2b670ea53a Persist item work 2024-04-15 11:17:10 -04:00
MagicBot 5ade37f7a4 Persist item work 2024-04-15 11:15:34 -04:00
MagicBot 1be657d3ef Persist item work 2024-04-15 11:07:26 -04:00
MagicBot 9dbefcd830 Unused variable removed 2024-04-15 11:01:53 -04:00
MagicBot e1a9ddae89 forged items are persisted 2024-04-14 17:30:35 -04:00
MagicBot 2690c3212b forged items are persisted 2024-04-14 17:18:58 -04:00
MagicBot aac7e46ae8 forged items are persisted 2024-04-14 17:04:59 -04:00
MagicBot a16bef418b forged items are persisted 2024-04-14 17:02:36 -04:00
MagicBot 8b4b3b971a forged items are persisted 2024-04-14 16:46:31 -04:00
MagicBot 692ee51608 forged items are persisted 2024-04-14 16:31:05 -04:00
MagicBot d5bd500f39 forged items are persisted 2024-04-14 16:29:17 -04:00
MagicBot e195d86fb6 Serialization update 2024-04-14 15:49:08 -04:00
MagicBot 114aeb9f64 Update NPC window 2024-04-14 15:38:24 -04:00
MagicBot d95bc5c261 Initialize all collections for npc 2024-04-14 15:30:10 -04:00
MagicBot 73fa5b5c7e Support for non-random rolling 2024-04-14 15:19:55 -04:00
MagicBot 85e5e2a7e3 Init forge support only for valid contracts 2024-04-14 15:17:32 -04:00
MagicBot 48f88ec819 Serialization update 2024-04-14 15:11:10 -04:00
MagicBot 139998eaa1 Moved declaration outside of loop 2024-04-14 15:02:52 -04:00
MagicBot 673f606de8 Cleanup of cache usage 2024-04-14 15:00:25 -04:00
MagicBot 9464500e95 More integration work 2024-04-14 14:48:59 -04:00
MagicBot 5e5b9884ef Begin integration 2024-04-14 14:13:10 -04:00
MagicBot 94ab64d629 reformat class 2024-04-14 14:11:22 -04:00
MagicBot 2c89509fa2 Moved logging message up 2024-04-14 14:07:06 -04:00
MagicBot fae81a0263 Removed cast in validation 2024-04-14 13:58:25 -04:00
MagicBot a8d5521dd8 Mobtype work related to ForgeManager 2024-04-14 13:51:37 -04:00
MagicBot ea555be08e Mobtype work related to ForgeManager 2024-04-14 13:13:28 -04:00
MagicBot 74e97fb435 Minor cleanup 2024-04-14 12:41:16 -04:00
MagicBot eed25d8c16 Minor cleanup 2024-04-14 12:24:53 -04:00
MagicBot bc195c27db Rework of error handling. 2024-04-14 12:14:17 -04:00
MagicBot 0653828fe3 Rework of error handling. 2024-04-14 12:13:51 -04:00
MagicBot 2feba8ac50 Rework of error handling. 2024-04-14 12:08:51 -04:00
MagicBot 5e7515a9ad Merge remote-tracking branch 'refs/remotes/origin/bugfix-combat-range' into feature-workorder2.4 2024-04-14 11:55:19 -04:00
FatBoy 2aaca661e2 new combat finalized 2024-04-13 19:44:03 -05:00
FatBoy 3f27bae099 mobs dont double tap when unarmed 2024-04-13 19:12:09 -05:00
FatBoy 79f4a33b6e add half player character height to attack range in lieu of hitbox 2024-04-13 19:10:10 -05:00
MagicBot ec47e24549 Not yet set when validating. 2024-04-13 12:26:39 -04:00
MagicBot 8fe7a6e896 Class cleanup 2024-04-13 11:28:48 -04:00
MagicBot f068e6891e Collection declaration cleanup 2024-04-13 10:10:17 -04:00
MagicBot cabbf8bf44 Java 8 TimeUnit 2024-04-13 10:06:44 -04:00
MagicBot 9c146fff4d Only random rolled items are unidentified. 2024-04-13 10:01:35 -04:00
MagicBot 333fcc9d14 Multiple item workOrder work 2024-04-13 09:53:20 -04:00
MagicBot 4aca075da6 Multiple item workOrder work 2024-04-13 09:38:58 -04:00
MagicBot a5bcdff216 Multiple item workOrder work 2024-04-13 09:31:18 -04:00
MagicBot 3c704d6b85 Multiple item workOrder work 2024-04-13 09:22:23 -04:00
MagicBot d26214d032 Multiple item workOrder work 2024-04-13 09:20:25 -04:00
MagicBot 09c96c772e Multiple item workOrder work 2024-04-13 09:10:56 -04:00
MagicBot f6e1c78b0b Debug string update 2024-04-13 08:57:53 -04:00
MagicBot ec80146117 forge items each cycle 2024-04-13 08:51:02 -04:00
MagicBot 980dee2e14 Work on multiple slot support 2024-04-13 08:31:36 -04:00
MagicBot 832b994757 Begin work on forgeItem() 2024-04-13 08:19:09 -04:00
MagicBot a18785fb3d Begin work on forgeItem() 2024-04-13 08:10:59 -04:00
MagicBot f076b38044 Contextual variable name updates 2024-04-13 07:54:26 -04:00
MagicBot 68f2af5306 Bugfix in delay override 2024-04-13 07:44:16 -04:00
MagicBot 052867893c Bugfix in delay override 2024-04-13 07:31:17 -04:00
MagicBot 13ba31285e Logging on each cycle 2024-04-13 07:26:39 -04:00
MagicBot 61a418fd8e Debug comment update 2024-04-13 07:18:55 -04:00
MagicBot 3fa4185b7f Debug comment update 2024-04-13 06:55:49 -04:00
MagicBot 5cb08c1dc0 Forge must be protected 2024-04-13 06:53:36 -04:00
MagicBot fc3a0eaf0c Forge must be protected 2024-04-13 06:48:58 -04:00
MagicBot 2e83b8c693 Better context in name 2024-04-13 06:42:21 -04:00
MagicBot 44eafc3345 Validation work 2024-04-12 17:41:08 -04:00
MagicBot 29ce3537f7 Work on cost overflow calculations 2024-04-12 17:29:52 -04:00
MagicBot 058887ff4d Locked resources are always unavailable. 2024-04-12 17:16:12 -04:00
MagicBot dc18e71ee4 Locked resources are always unavailable. 2024-04-12 17:15:04 -04:00
MagicBot 479e38e3f6 Validation work 2024-04-12 17:06:42 -04:00
MagicBot dd764281e8 Rolling duration updated 2024-04-12 16:52:43 -04:00
MagicBot f7959a51bd Rolling duration updated 2024-04-12 16:43:22 -04:00
MagicBot 97e0ada1a9 workerOrder cost updating 2024-04-12 16:16:34 -04:00
MagicBot cc3d5fe076 workerOrder cost updating 2024-04-12 15:48:25 -04:00
MagicBot 2200cb9bef workerOrder cost updating 2024-04-12 15:41:15 -04:00
MagicBot a16cda8a4a workerOrder cost updating 2024-04-12 15:31:12 -04:00
MagicBot af53859ba9 Comment added 2024-04-11 13:46:24 -04:00
MagicBot a7a1230f1b Work on wordOrder iteration 2024-04-10 18:01:27 -04:00
MagicBot df037a51f0 More info on template bootstrap 2024-04-10 17:40:00 -04:00
MagicBot 4d18e71aa1 More info on template bootstrap 2024-04-10 17:33:59 -04:00
MagicBot 7f579e5268 Bane rank loaded from template 2024-04-10 17:22:45 -04:00
MagicBot f6c53e51ed Calculate cost of workOrder 2024-04-10 16:47:02 -04:00
MagicBot 1429a3a4d5 Configure upon submit() 2024-04-10 16:06:09 -04:00
FatBoy dc81ddaba7 handle retaliate when being attacked 2024-04-09 21:23:29 -05:00
FatBoy 4a001179b5 add hitbox to abs vs abs range checks 2024-04-08 20:37:27 -05:00
FatBoy 1bff06cde0 using building bounds and hitBox for mele range 2024-04-08 20:20:16 -05:00
MagicBot ba4648f812 Minor class cleanup 2024-04-08 17:56:51 -04:00
MagicBot 1d0ab95b88 Minor class cleanup 2024-04-08 17:52:35 -04:00
MagicBot 275644ec83 Minor class cleanup 2024-04-08 17:42:47 -04:00
MagicBot 69416528b3 Minor class cleanup 2024-04-08 17:40:38 -04:00
MagicBot d3e0146d86 Minor class cleanup 2024-04-08 17:16:05 -04:00
MagicBot 35fab88949 Minor class cleanup 2024-04-08 17:15:56 -04:00
MagicBot 27a37eba79 Minor class cleanup 2024-04-08 17:06:42 -04:00
MagicBot deb5b36309 Minor class cleanup 2024-04-08 17:02:20 -04:00
MagicBot b84de95865 Minor class cleanup 2024-04-08 16:58:07 -04:00
MagicBot 5650c0f05a Minor class cleanup 2024-04-08 16:54:33 -04:00
MagicBot afa1b8478a Minor class cleanup 2024-04-08 16:53:53 -04:00
MagicBot cafe0a0fe1 Minor class cleanup 2024-04-08 16:49:19 -04:00
MagicBot bfa43823f6 Minor class cleanup 2024-04-08 16:42:44 -04:00
MagicBot 533ed87321 Minor class cleanup 2024-04-08 16:26:56 -04:00
MagicBot 129bd4aaa6 Minor class cleanup 2024-04-08 16:26:29 -04:00
MagicBot eb93481fda Merge branch 'feature-workorder2.4' of http://repo.magicbane.com/MagicBane/Server into feature-workorder2.4 2024-04-08 16:23:41 -04:00
MagicBot a160fe1b00 Time recycle update 2024-04-08 16:23:08 -04:00
MagicBot c2f70c0f26 Unused method removed 2024-04-08 15:58:48 -04:00
MagicBot 98c0712dea Method to calculate warehosue overflow. 2024-04-08 15:55:57 -04:00
MagicBot 7c4f7f391b Method to calculate warehosue overflow. 2024-04-08 15:54:25 -04:00
MagicBot e01dc9b09c More fleshing out of workorder usage 2024-04-08 13:15:40 -04:00
MagicBot 178bb3718a Slot count calculated 2024-04-08 13:10:23 -04:00
MagicBot f088d2aa72 More WorkOrder work 2024-04-08 13:06:22 -04:00
MagicBot 0645a93b9c Track items and their workorders. 2024-04-08 04:46:54 -04:00
MagicBot 8b38f1a695 Track items and their workorders. 2024-04-08 04:42:44 -04:00
MagicBot 652476fde8 Track items and their workorders. 2024-04-08 04:37:27 -04:00
MagicBot 74a7a255be Track items and their workorders. 2024-04-08 04:32:04 -04:00
MagicBot abd112035a Track items and their workorders. 2024-04-08 04:17:31 -04:00
MagicBot f5f92a1d88 rollingDuration fleshed out 2024-04-07 23:21:35 -04:00
MagicBot 75d520831f More workorder logic work 2024-04-07 23:00:37 -04:00
MagicBot 92402097d4 ForgeManager started at boot 2024-04-07 22:53:41 -04:00
MagicBot 5e92bab977 submit workorder to forgemanager 2024-04-07 22:40:14 -04:00
MagicBot a5df674fbe Update to debug strings 2024-04-07 22:34:06 -04:00
MagicBot 4462f74f8c More workorder work. 2024-04-07 22:31:58 -04:00
MagicBot 781053ab22 Debug string added 2024-04-07 22:28:07 -04:00
MagicBot 053c105c26 Method to validate workorder 2024-04-07 22:21:47 -04:00
MagicBot 46bf67672a workorder fields assigned 2024-04-07 22:18:12 -04:00
MagicBot d539e419fe Begin adding workOrder logic 2024-04-07 22:15:06 -04:00
MagicBot ec5a8f5281 Logic cleanup. 2024-04-07 13:25:42 -04:00
MagicBot 97558b51c8 Method moved to top of handler. 2024-04-07 13:23:22 -04:00
MagicBot 4a3a8d4b65 Minor class cleanup 2024-04-07 13:10:58 -04:00
MagicBot 85a66339e2 inline accessors 2024-04-07 13:08:00 -04:00
MagicBot b785d35231 Removed unused method 2024-04-07 13:03:24 -04:00
MagicBot 21b1dba84d Switch directly on actiontype 2024-04-07 13:01:43 -04:00
MagicBot fc71b8cb61 Inline setter 2024-04-07 12:53:55 -04:00
MagicBot 31129493e5 ActionType Take 2024-04-07 12:51:58 -04:00
MagicBot 8b4eafebf3 Elevate access. It's a message... 2024-04-07 12:48:56 -04:00
MagicBot cf38362d84 Handler uses enumeration 2024-04-07 12:45:13 -04:00
MagicBot 30800478f2 Message now uses enum 2024-04-07 12:04:15 -04:00
MagicBot 9bbe9b399e Better name for map 2024-04-06 16:08:06 -04:00
MagicBot 16d17798be Mirror field in client 2024-04-06 16:06:55 -04:00
MagicBot 679c7afe0e field is templateID not item uuid. 2024-04-06 16:05:52 -04:00
MagicBot f10141eddb Variable removed from city 2024-04-06 15:45:45 -04:00
MagicBot 10805a7d37 Class moved up in package 2024-04-06 15:30:35 -04:00
MagicBot b979fbb1bc Begin message rewrite 2024-04-06 14:01:23 -04:00
MagicBot b86ca33087 Unused variables removed 2024-04-06 10:56:31 -04:00
MagicBot 993abfbf6f variable renamed 2024-04-06 07:26:17 -04:00
MagicBot ffd41101c3 variable renamed 2024-04-05 20:14:29 -04:00
MagicBot 39e06994d9 Workorder and Forgemanger classes created 2024-04-05 20:13:16 -04:00
MagicBot ec405226c5 Formation refactored to enum 2024-04-05 19:37:45 -04:00
MagicBot 627a35e364 Update to devcmd 2024-04-05 09:43:30 -04:00
MagicBot 6254472bb8 New column used in rs constructor 2024-04-05 09:35:38 -04:00
MagicBot 0bbedd5983 Code removed; column populated 2024-04-05 09:33:57 -04:00
MagicBot 58fb2a9b90 Populate new column in table. 2024-04-05 09:30:00 -04:00
MagicBot f7c76937fb Writing string of bitset for contracts. 2024-04-05 09:18:12 -04:00
MagicBot 52865d7cfd refactored out dependency 2024-04-05 08:57:00 -04:00
MagicBot 8424aa557f refactored out dependency 2024-04-05 08:55:41 -04:00
MagicBot 0ab7bafe5e refactored out dependency 2024-04-05 08:54:58 -04:00
MagicBot 43b212ed42 refactored out dependency 2024-04-05 08:53:18 -04:00
MagicBot 0b4873a522 refactored out dependency 2024-04-05 08:44:59 -04:00
MagicBot d3d1227d6c refactored out dependency 2024-04-05 08:35:48 -04:00
MagicBot 181e7661c1 fromString and asString EnumSet helper methods created 2024-04-05 08:10:28 -04:00
MagicBot c1ee6f5b52 Renamed class to not conflict with the java.lang version. 2024-04-05 07:59:44 -04:00
MagicBot dd84615ca1 Optimization moved to method 2024-04-04 15:26:32 -04:00
MagicBot aad0418260 Faster if bitvector is 0. 2024-04-04 15:18:43 -04:00
MagicBot 46f3850e93 Values parsed as behaviourtype enumset 2024-04-04 15:16:11 -04:00
MagicBot ab34931c3d Test if value is enumset 2024-04-04 15:05:25 -04:00
MagicBot 52116063e5 Test if value is enumset 2024-04-04 15:02:19 -04:00
MagicBot 04243cc21e Arraylists of ints 2024-04-04 14:27:07 -04:00
MagicBot 1ab041ce0f Last two variables need work. 2024-04-04 14:05:05 -04:00
MagicBot 1dac740fca Bitvector helper method added. 2024-04-04 13:59:30 -04:00
MagicBot 1e3e173dfe Final class cleanup. 2024-04-04 13:27:43 -04:00
MagicBot 27971c5fb3 not_enemy_types_json parsed 2024-04-04 13:18:37 -04:00
MagicBot 52fab5d92b not_enemy_types_json parsed 2024-04-04 13:18:19 -04:00
MagicBot 5054006ffc not_enemy_types_json parsed 2024-04-04 13:15:53 -04:00
MagicBot f4e24e032b rune_enemy_monster_types parsed 2024-04-04 13:14:21 -04:00
MagicBot 2248361503 rune_enemy_monster_types parsed 2024-04-04 13:13:14 -04:00
MagicBot 5c20fca28a Rune skill adjusts parsed 2024-04-04 12:16:29 -04:00
MagicBot 9bbb949868 Rune skill adjusts parsed 2024-04-04 11:54:01 -04:00
MagicBot 3e6bfacd86 Fix for mixed type values 2024-04-04 11:43:02 -04:00
MagicBot 1043c84b9d Both sparse fields parsed 2024-04-04 11:34:02 -04:00
MagicBot febada8d63 Both sparse fields parsed 2024-04-04 11:15:47 -04:00
MagicBot 8b6fef4cbc Both sparse fields parsed 2024-04-04 11:13:58 -04:00
MagicBot 1ce9029edf Fix to rune_group parsing 2024-04-04 11:02:50 -04:00
MagicBot 587ac802de Fix to rune_group parsing 2024-04-04 11:00:19 -04:00
MagicBot 58455843f9 long not double 2024-04-04 10:54:43 -04:00
MagicBot a09ac1f2a2 long not double 2024-04-04 10:54:22 -04:00
MagicBot 8c454c5d7c Using name as template id is not yet set. 2024-04-04 10:47:55 -04:00
MagicBot 83dd47d22a Test 2024-04-04 10:46:40 -04:00
MagicBot c2910bb87c Test 2024-04-04 10:45:45 -04:00
MagicBot 7e6c051a02 More parsing work; sparse_data field loaded into string for now. 2024-04-04 10:39:54 -04:00
MagicBot 35b368d7fe rune_speed parsed 2024-04-04 10:37:12 -04:00
MagicBot d39790ab4c More parsing work 2024-04-04 10:23:21 -04:00
MagicBot 09d28b964a More parsing work 2024-04-04 10:13:25 -04:00
MagicBot 139490e943 Fields defined. 2024-04-04 10:07:42 -04:00
MagicBot 8830388728 More rune parsing work 2024-04-04 09:56:25 -04:00
MagicBot 68b9f9e887 More rune parsing 2024-04-04 09:54:52 -04:00
MagicBot 5ef45a2212 Parsing power_granted_skills 2024-04-04 09:52:19 -04:00
MagicBot 772e7f7f29 Parsing power_granted_skills 2024-04-04 09:43:41 -04:00
MagicBot 8afa00f885 Parsing skill_granted_skills 2024-04-04 09:34:44 -04:00
MagicBot fcf76011f4 power_granted_skills hashmap defined 2024-04-03 16:14:21 -04:00
MagicBot 3e2f420c30 skills_granted_array started for rune 2024-04-03 13:40:24 -04:00
MagicBot 26fd6f8de2 Update to error string 2024-04-03 12:57:02 -04:00
MagicBot 0966b82d5f rune_skill_grant parsed 2024-04-02 15:24:52 -04:00
MagicBot d526d69bca rune_skill_grant parsed 2024-04-02 15:17:33 -04:00
MagicBot 242984ffaf Rune attribute and max attribute adjusts parsed 2024-04-02 14:44:50 -04:00
MagicBot 4746a8c9cf More parsing work. 2024-04-02 14:41:22 -04:00
MagicBot 1603c8d8e9 Rename to conform 2024-04-02 14:37:01 -04:00
MagicBot ddba4f290d Rename to conform 2024-04-02 14:14:27 -04:00
MagicBot d621877e8c Begin rune parsing 2024-04-02 14:11:01 -04:00
MagicBot 713a52f705 Serialize current stats 2024-04-02 13:09:24 -04:00
MagicBot c68d5e0730 Attack bypass inserted 2024-04-02 12:49:36 -04:00
MagicBot 49c62fae60 Debug string 2024-04-02 12:42:28 -04:00
MagicBot 3bd4e75422 Debug string 2024-04-02 12:38:19 -04:00
MagicBot 791e5cb9b8 Attack early exit 2024-04-02 12:36:36 -04:00
MagicBot 2fb8f53751 Attack early exit 2024-04-02 12:33:01 -04:00
MagicBot dc366068a9 Methods moved to new handler 2024-04-02 12:00:59 -04:00
MagicBot 3ec76ab816 ItemManager created 2024-04-02 11:53:22 -04:00
MagicBot d8750f5e2c Unused methods removed 2024-04-01 17:28:48 -04:00
MagicBot f272be8b4d Header added to class 2024-04-01 17:26:38 -04:00
MagicBot f8f86d8e46 Header added to new class 2024-04-01 17:25:56 -04:00
MagicBot ee030a690a Project reformat 2024-04-01 17:00:14 -04:00
MagicBot 3df1da364c Magic number removed 2024-04-01 16:54:10 -04:00
MagicBot 389373be30 Not static 2024-04-01 16:45:00 -04:00
MagicBot cc02be95f3 Proper parsing of power grants 2024-04-01 16:32:17 -04:00
MagicBot 5a1027c611 Proper parsing of power grants 2024-04-01 16:26:35 -04:00
MagicBot 64e780744d Proper parsing of power grants 2024-04-01 16:23:54 -04:00
MagicBot 0abffeeb7f Proper parsing of power grants 2024-04-01 16:21:56 -04:00
MagicBot 75f11deee1 Proper parsing of power grants 2024-04-01 16:20:03 -04:00
MagicBot db91b606f6 Proper parsing of power grants 2024-04-01 16:12:52 -04:00
MagicBot 82373f8cc8 Proper parsing of power grants 2024-04-01 16:05:55 -04:00
MagicBot 946714d3ae Proper parsing of power grants 2024-04-01 15:53:36 -04:00
MagicBot 8414b0f4cf Consumable items are item_power_grant for their lookup 2024-04-01 15:26:52 -04:00
MagicBot faa262db99 Revert "Temp fix for 3 modifiers"
This reverts commit 6955f69156.
2024-04-01 14:21:16 -04:00
MagicBot 6955f69156 Temp fix for 3 modifiers 2024-04-01 13:51:20 -04:00
MagicBot 2ae39d2a29 Corrected source type 2024-04-01 13:07:18 -04:00
MagicBot 8e44adf16e No need for toUpper() here. 2024-04-01 12:58:16 -04:00
MagicBot fd73dbc349 Source types updated to match damage type 2024-04-01 12:53:49 -04:00
MagicBot f58aa61859 PIERCING 2024-04-01 12:42:49 -04:00
MagicBot ae7fecbf6d Effectbase updated with new enum 2024-04-01 12:41:33 -04:00
MagicBot 5ed497dd69 All damage type lookups go through method 2024-04-01 12:35:44 -04:00
MagicBot 14ee83e147 DamageType defined as in JSON 2024-04-01 12:13:19 -04:00
MagicBot a29269e335 Initial refactor of damagetype 2024-04-01 09:19:37 -04:00
MagicBot adfbf87056 Handler update. 2024-03-31 11:22:22 -04:00
MagicBot d80231eef0 Handler update. 2024-03-31 11:20:32 -04:00
MagicBot 3395efee49 bugfix: wrong char! 2024-03-31 11:01:12 -04:00
MagicBot 7acaccc77d Protocol handler code update 2024-03-31 10:54:33 -04:00
MagicBot 5aa01d94fd New handlers plugged into protocol class 2024-03-31 10:50:40 -04:00
MagicBot 7b405bbbf3 New handlers plugged into protocol class 2024-03-31 10:49:08 -04:00
MagicBot 504e26114e Migration to protocol class 2024-03-31 10:42:17 -04:00
MagicBot 4e5e49606c Methods moved out of old login handler 2024-03-31 10:37:03 -04:00
MagicBot f62f11a66c Handler created for GameServerIPRequestMsg 2024-03-31 10:33:46 -04:00
MagicBot 7911a17f0c Handler created for deletecharmsg 2024-03-31 10:26:01 -04:00
MagicBot 5c8c4fc817 Handler created for deletecharmsg 2024-03-31 10:25:25 -04:00
MagicBot 854d0a8a68 Handler created for commitnewcharmsg 2024-03-31 10:20:44 -04:00
MagicBot 61fca2c742 Handler created for ServerInfoMsg 2024-03-31 10:13:17 -04:00
MagicBot b752006d6f Handlers created for VersionInfoMsg and ClientLoginInfoMsg 2024-03-31 10:09:32 -04:00
MagicBot f9c0a9c3b5 Decoration type 2.1 JSON 2024-03-30 14:57:36 -04:00
MagicBot 71300f189d Parm name update 2024-03-30 14:16:20 -04:00
MagicBot d3fe643223 Madness; refactor out? 2024-03-30 14:15:23 -04:00
MagicBot 0cf4b5416d Refactor of signature 2024-03-30 14:04:08 -04:00
MagicBot a98de7b6fc Unused method 2024-03-30 13:54:33 -04:00
MagicBot efa7e6a03a UPDATE_EQUIP_SLOT db method plugged in 2024-03-30 13:43:01 -04:00
MagicBot 407fe9d583 Fixing equipslot db issue 2024-03-30 13:25:45 -04:00
MagicBot 36d8a6bdbd Fixing equipslot db issue 2024-03-30 13:04:35 -04:00
MagicBot cdd746e0df Removed extra squigglies 2024-03-30 12:44:12 -04:00
MagicBot 4e1621db99 Sql bugfix 2024-03-30 11:46:56 -04:00
MagicBot e5622a47c0 Inline templateID 2024-03-30 08:26:08 -04:00
FatBoy 46170e3ab7 players can use weapon powers again 2024-03-29 19:11:47 -05:00
FatBoy 01533b1056 auto attack timer for players fixed 2024-03-29 19:06:34 -05:00
FatBoy 87e24c16d9 Merge remote-tracking branch 'origin/feature-json7.4' into feature-json7.4 2024-03-29 19:06:17 -05:00
FatBoy 572bff8d6b auto attack timer for players fixed 2024-03-29 19:05:56 -05:00
MagicBot 52d37296a7 Uppercase for source type 2024-03-29 15:31:32 -04:00
MagicBot f682f9a5ae Uppercase for source type 2024-03-29 15:28:01 -04:00
MagicBot 2f3b9e0fb2 Uppercase for source type 2024-03-29 15:26:44 -04:00
MagicBot cfc36c0c27 Equipslot stored as string 2024-03-29 13:23:56 -04:00
MagicBot 0e431aa726 Handler written for protocol class 2024-03-29 10:08:11 -04:00
MagicBot 25ab3747eb Handler written for protocol class 2024-03-29 10:07:33 -04:00
MagicBot 7526cc808c TradeManager removed 2024-03-29 08:59:14 -04:00
MagicBot 019c254ac1 Handler created for InvalidTradeRequestMsg 2024-03-29 08:58:31 -04:00
MagicBot 8cd613c597 Handler created for CloseTradeWindow 2024-03-29 08:55:22 -04:00
MagicBot 5f16289052 Handler created for UnCommitToTradeMsg 2024-03-29 08:48:43 -04:00
MagicBot 2768980f6e Handler created for CommitToTradeMsg 2024-03-29 08:44:12 -04:00
MagicBot 3a2b138deb Handler created for AddGoldToTradeWindowMsg 2024-03-29 08:39:49 -04:00
MagicBot 3f1385dd33 Handler created for AddItemToTradeWindowMsg 2024-03-29 08:34:29 -04:00
MagicBot a70585448f RejectTradeRequest has no handler 2024-03-29 08:27:48 -04:00
MagicBot d4e38c113b Handler created for AceeptTradeMsg 2024-03-29 08:23:53 -04:00
MagicBot d7b18dc457 Handler created for RequestToTrade 2024-03-29 08:14:27 -04:00
MagicBot 7b909e1044 Handler created for AbstractChatMsg 2024-03-29 08:03:56 -04:00
MagicBot 4fd1a1a146 Handler created for AbstractChatMsg 2024-03-29 08:02:56 -04:00
MagicBot 9934e60fa4 Handler created for AbstractChatMsg 2024-03-29 08:02:00 -04:00
MagicBot b74105137e Handler created for AbstractChatMsg 2024-03-29 07:54:57 -04:00
MagicBot 301014f06f Handler created for AbstractChatMsg 2024-03-29 07:54:00 -04:00
MagicBot a37825168b Handler created for AbstractChatMsg 2024-03-29 07:50:57 -04:00
MagicBot 093bc5e97e Handler created for RecvSummonsMsg 2024-03-29 07:41:40 -04:00
MagicBot f0ac342b1f Handler created for SendSummonsMsg 2024-03-29 07:36:33 -04:00
MagicBot 8997701d8a Handler created for TrackWindowMsg 2024-03-29 07:30:24 -04:00
MagicBot ce403a6bd8 Handler created for TrainerInfoMsg 2024-03-29 07:11:01 -04:00
MagicBot bf712accf9 Handler created for RefineScreenMsg 2024-03-29 07:07:25 -04:00
MagicBot 1825035739 Handler created for RefineMsg 2024-03-29 07:04:46 -04:00
MagicBot 5a5fd8155c Handler created for StuckMsg 2024-03-29 06:52:11 -04:00
MagicBot 56bc38ab73 Handler created for PetAttackMsg 2024-03-29 06:45:26 -04:00
MagicBot 01fd6997a8 Handler created for ShowMsg 2024-03-29 06:40:06 -04:00
MagicBot 41f77364aa Cleanup of handler super calls 2024-03-29 06:35:17 -04:00
MagicBot 1acb74ade1 Handler created for RespawnMsg 2024-03-29 06:30:07 -04:00
MagicBot 35ba4bbeec CosttoOpenBankMsg has no handler 2024-03-29 06:26:59 -04:00
MagicBot a162377685 Handler created for ModifyStatMsg 2024-03-29 06:23:29 -04:00
MagicBot 5a1806d11b Handler created for PetCmdMsg 2024-03-29 06:17:46 -04:00
MagicBot 80c11db80b Handler created for ViewResourcesMsg 2024-03-29 06:14:19 -04:00
MagicBot fbec206389 Handler created for IgnoreMsg 2024-03-29 06:08:04 -04:00
MagicBot 7b9d9d64bb Handler created for ToggleSitStandMsg 2024-03-29 06:02:29 -04:00
MagicBot e86097d732 Handler created for LFGmsg 2024-03-29 05:58:38 -04:00
MagicBot a103e7c7cd Handlers created for toggle combat messages 2024-03-29 05:48:19 -04:00
MagicBot f653376c22 Handler created for ClientAdminCommandMsg 2024-03-29 05:31:16 -04:00
MagicBot 4bc19235a6 Handler created for LootMsg 2024-03-29 04:59:27 -04:00
MagicBot 06e41d5b94 Handler created for LootWindowRequestMsg 2024-03-29 04:52:07 -04:00
MagicBot 8083f39ba1 Handler created for DeleteItemMsg 2024-03-29 04:46:45 -04:00
FatBoy 162a049f30 mob attack delay 2024-03-28 22:29:47 -05:00
FatBoy 0486fa52e4 mob attack delay 2024-03-28 22:17:08 -05:00
FatBoy 0e9390ef53 mob attack delay 2024-03-28 22:15:48 -05:00
FatBoy f47a9772d7 mob attack delay 2024-03-28 22:08:03 -05:00
FatBoy 08060cf06f mob baseline stats 2024-03-28 21:46:54 -05:00
FatBoy 25fed51523 canRoll work 2024-03-28 21:06:57 -05:00
FatBoy 8c39ede852 canRoll work 2024-03-28 21:02:06 -05:00
FatBoy 692c6a268c canRoll work 2024-03-28 20:55:28 -05:00
FatBoy 415ec5f5d4 array list cast for canRoll 2024-03-28 20:47:29 -05:00
FatBoy 0c1431e60d SQL fix 2024-03-28 20:37:45 -05:00
FatBoy df07c80b1b combat manager fix 2024-03-28 20:25:40 -05:00
MagicBot 94253f547d Bugfix in deserialization 2024-03-28 20:44:14 -04:00
MagicBot 2640927b85 Value tweak 2024-03-28 19:34:27 -04:00
MagicBot fc06ea97bd Refactor out itembase 2024-03-28 12:17:58 -04:00
MagicBot 561b80b1aa Refactor out itembase 2024-03-28 12:15:43 -04:00
MagicBot 230679cef9 Templates backfilled with modtable data 2024-03-28 12:08:09 -04:00
MagicBot 8e43f17da0 Can roll list refactored 2024-03-28 11:50:22 -04:00
MagicBot a109e9864f More itembase refactor 2024-03-28 05:42:27 -04:00
MagicBot 5d367a737c More itembase refactor 2024-03-28 05:39:54 -04:00
MagicBot 2b7cc2bdd7 More itembase refactor 2024-03-28 05:38:38 -04:00
MagicBot 60c80ceee8 More itembase refactor 2024-03-28 05:35:39 -04:00
MagicBot 1cf9831e20 Itembase refactored out of gold 2024-03-28 05:34:50 -04:00
MagicBot 08f0fc1743 More itembase refactor 2024-03-28 05:21:45 -04:00
MagicBot 2aa9f9c134 More itembase refactor 2024-03-28 05:20:35 -04:00
MagicBot 3ee0ec1342 More itembase refactor 2024-03-28 05:10:22 -04:00
MagicBot 85a179ad47 More itembase refactor 2024-03-28 05:09:04 -04:00
MagicBot 03e6c591ff More itembase refactor 2024-03-28 05:06:04 -04:00
MagicBot 03c226f76e More itembase refactor 2024-03-28 05:04:59 -04:00
MagicBot 59bf787581 ItemTableEntry column update 2024-03-28 05:02:39 -04:00
MagicBot 61bb7be6b1 More itembase refactor 2024-03-28 05:01:29 -04:00
MagicBot 84c29a1222 More itembase refactor 2024-03-28 04:59:30 -04:00
MagicBot 02d8bf4f5c Bootyset column update 2024-03-28 04:53:45 -04:00
MagicBot eba8beb8f5 More itembase refactor 2024-03-28 04:52:01 -04:00
MagicBot 3dcffa3042 More itembase refactor 2024-03-28 04:50:08 -04:00
MagicBot 04991c94ba dyn_npc_production column update 2024-03-28 04:40:38 -04:00
MagicBot ee8e4f8a2e Inventoryset column update 2024-03-28 04:38:52 -04:00
MagicBot 594509e0ad Parm removed from stored procedure. 2024-03-28 04:35:08 -04:00
MagicBot d57eb295e9 Schema update 2024-03-28 04:24:36 -04:00
MagicBot b8a1081544 Debug code removed. 2024-03-28 04:11:46 -04:00
MagicBot 045b101d7b Bypass for mobiles in def logic 2024-03-28 03:59:22 -04:00
MagicBot 76ae0f4b59 This should fail fast. 2024-03-28 03:42:29 -04:00
MagicBot 2cfbd77e2f Update to error message 2024-03-28 03:33:40 -04:00
MagicBot 768e209b2b signature names updated 2024-03-28 03:30:00 -04:00
MagicBot eb621f184d Update to skill_used logic 2024-03-28 03:24:57 -04:00
FatBoy ebf7130b63 defense bug fix 2024-03-27 18:32:46 -05:00
FatBoy a65ecfeb65 damage calculated as int 2024-03-27 18:18:41 -05:00
FatBoy 1b384a6d11 damage calculated as int 2024-03-27 18:10:58 -05:00
FatBoy cde9901bb6 remove ItemBase variables 2024-03-27 18:00:20 -05:00
FatBoy 7f452d18bc remove ItemBase from NPCManager 2024-03-27 17:54:28 -05:00
FatBoy ce7b9ff96f remove ItemBase from NPC 2024-03-27 17:49:35 -05:00
FatBoy 3ff9115052 remove ItemBase from LootManager 2024-03-27 17:47:38 -05:00
FatBoy 6c78e7d9fa remove ItemBase from LootManager 2024-03-27 17:43:49 -05:00
FatBoy 6514fd8dc3 remove ItemBase from NPC 2024-03-27 17:39:42 -05:00
FatBoy a741bb3482 remove ItemBase from PlayerCharacter 2024-03-27 17:36:43 -05:00
FatBoy def5ceee46 remove ItemBase form absChar and Mob 2024-03-27 17:31:04 -05:00
FatBoy aff2a8fa0e ABS char skill system 2024-03-27 17:17:34 -05:00
FatBoy 27d869276a purge ItemBase form mobAI 2024-03-27 16:53:44 -05:00
MagicBot 7e3a8a7a40 Handler created for LeaveWorldMsg 2024-03-27 14:10:59 -04:00
MagicBot c33cd9773f Handler created for RandomMsg 2024-03-27 14:01:32 -04:00
MagicBot 2d246a6773 Handler created for TrainMsg 2024-03-27 13:57:36 -04:00
MagicBot fa5980bc6a Handler created for GuildTreeStatusMSg 2024-03-27 13:51:14 -04:00
MagicBot 17f18b83f4 Handler created for PerformActionMsg 2024-03-27 13:41:58 -04:00
MagicBot 507ec302e7 Handler created for PromptRecallMsg 2024-03-27 13:34:32 -04:00
MagicBot 5cfbd9998c Handler created for UseCharterMsg 2024-03-27 13:29:33 -04:00
MagicBot 68ae9c1b97 Handler created for SocialMSg 2024-03-27 13:26:47 -04:00
MagicBot 5397833dea Handler created for WhoRequestMsg 2024-03-27 13:23:00 -04:00
MagicBot 4598709ba1 Handler created for UpdateStateMsg 2024-03-27 13:19:05 -04:00
MagicBot ac92d69914 Handler created for TargetObjectMsg 2024-03-27 13:15:06 -04:00
MagicBot a1f233723f Cleanup of value handling 2024-03-27 13:09:35 -04:00
MagicBot 063f3081b5 Methods moved out of message pump 2024-03-25 11:41:16 -04:00
MagicBot 72ce1e0694 Revert value store 2024-03-25 11:29:53 -04:00
MagicBot 0004215605 Revert value store 2024-03-25 11:29:04 -04:00
MagicBot c0a50544d7 Value is only an override 2024-03-25 06:35:45 -04:00
MagicBot a130240339 Value is only an override 2024-03-25 06:19:37 -04:00
MagicBot 54cd1c59f7 Value is only an override 2024-03-25 06:04:32 -04:00
MagicBot a7ed30130d Value is set as items as used or damaged. Not calculated on the fly. 2024-03-25 05:59:59 -04:00
MagicBot 4e2add4d64 Potion charges accounted for in price 2024-03-25 05:43:20 -04:00
MagicBot 6a62f93cba combat_health_full used from json 2024-03-25 05:29:15 -04:00
MagicBot f523e4832e Variable renamed to conform with json 2024-03-25 05:25:09 -04:00
MagicBot 28b0fd6fd4 Removed two variables 2024-03-25 05:21:59 -04:00
MagicBot 0f703785f3 Strip trailing ; when writing enumset 2024-03-25 04:50:58 -04:00
MagicBot ded3e16d48 Class renaming for clarity 2024-03-25 04:44:35 -04:00
MagicBot 678f5463ea Name given default value 2024-03-25 04:36:07 -04:00
MagicBot 575d21a786 Value logic update 2024-03-25 04:28:28 -04:00
MagicBot 4fa5ccf416 Value logic update 2024-03-25 04:26:55 -04:00
MagicBot eba905b15d Value set in constructor 2024-03-25 00:52:47 -04:00
MagicBot 14ccb1f80b Value set in constructor 2024-03-25 00:30:16 -04:00
MagicBot 9d140be510 Weight not value 2024-03-24 23:19:55 -04:00
MagicBot eb78716401 Update needed here for inventory 2024-03-24 11:10:59 -04:00
MagicBot 3074b77471 Handler created for VendorDialogMsg 2024-03-24 10:49:29 -04:00
MagicBot 53b7aca0ce Handlers created for vendor buy/sell windows 2024-03-24 10:34:41 -04:00
MagicBot 083349b75b Handlers created for gold-vault interactions 2024-03-24 10:21:53 -04:00
MagicBot ae3423b99b Handlers created for vault interactions 2024-03-24 10:13:00 -04:00
MagicBot 5439df5653 Handlers created for vault interactions 2024-03-24 10:12:16 -04:00
MagicBot e7e32ca4ef Handlers created for bank interaction 2024-03-24 10:01:43 -04:00
MagicBot e971674465 Handlers created for bank interaction 2024-03-24 09:56:41 -04:00
MagicBot 943d274e5f Project reformat. 2024-03-24 09:42:27 -04:00
MagicBot d0bb761344 Bugfix in item constructor 2024-03-24 09:40:47 -04:00
MagicBot a8ba5ae62b More accurate than BakedInStats 2024-03-24 09:39:38 -04:00
MagicBot 97c0b0bbee Unused method removed 2024-03-24 09:36:01 -04:00
MagicBot 67e0766894 New Handler created for SELLOBJECT 2024-03-24 09:18:05 -04:00
MagicBot 3fc5fa71a4 No enchants loaded from db for negative id items 2024-03-24 09:02:56 -04:00
MagicBot 4fc7c90c15 Method moved to handler. Less in Item the better. 2024-03-24 08:41:53 -04:00
MagicBot e50c519eec Rewrite of handler 2024-03-24 08:25:25 -04:00
MagicBot 57016da1d0 Rewrite of handler 2024-03-24 08:21:24 -04:00
MagicBot 8d1c6cc082 Rewrite of handler 2024-03-24 08:20:37 -04:00
MagicBot 2fb889272b Rewrite of handler 2024-03-24 08:14:40 -04:00
MagicBot 4194aa09d1 Rewrite of handler 2024-03-24 08:07:24 -04:00
MagicBot 0004bb63b0 Sell inventory get negative uid 2024-03-24 07:55:59 -04:00
MagicBot d7eef4c623 Logic update in byfromnpc 2024-03-23 19:39:38 -04:00
MagicBot 0fa042cece Final CombatManager 2024-03-23 19:22:14 -04:00
MagicBot 6a0599a972 Unused method removed 2024-03-23 19:11:29 -04:00
MagicBot cef2a7c188 Backfill code removed 2024-03-23 19:04:17 -04:00
MagicBot ab2659d01f Backfill code removed 2024-03-23 18:55:18 -04:00
MagicBot 601ed40eb2 Passives clamped at 75% 2024-03-23 18:39:03 -04:00
MagicBot 2bb414fc33 Update to passive logic 2024-03-23 18:33:32 -04:00
MagicBot ecc14fc3af Setting slot.NONE when moving to inventory 2024-03-23 09:25:49 -04:00
MagicBot ea38c3bef7 Unused Junk removal 2024-03-23 08:47:46 -04:00
MagicBot bf990a886c Ignoring current ident flag when back-filling 2024-03-22 14:36:44 -04:00
MagicBot 22d08b51b7 Back filling item flags 2024-03-22 14:24:46 -04:00
MagicBot 551361e10a Back filling item flags 2024-03-22 13:51:09 -04:00
MagicBot 99b9444ba8 Set flags when created 2024-03-22 13:24:54 -04:00
MagicBot c390ebe0c6 Empty check when reading enum 2024-03-22 13:19:56 -04:00
MagicBot 513118d42c Flags defined in in-memory constructor 2024-03-22 13:14:45 -04:00
MagicBot b0c43a5258 Back-fill support added. 2024-03-22 13:06:30 -04:00
MagicBot eca71fa685 Item flags refactored 2024-03-22 13:03:47 -04:00
MagicBot f01fb6f848 Variable rename 2024-03-22 12:37:40 -04:00
MagicBot 0f18258d1b Variable rename 2024-03-22 12:35:47 -04:00
MagicBot abc4a227a9 Comment cleanup 2024-03-22 12:34:48 -04:00
MagicBot 1c368003ae String rename 2024-03-22 12:33:34 -04:00
MagicBot ee34f9e8ec parameter rename 2024-03-22 12:28:58 -04:00
MagicBot d511eda713 Removed junk dev commands. 2024-03-20 13:48:01 -04:00
MagicBot 4b20b0efe3 Removed junk dev commands. 2024-03-20 13:46:57 -04:00
MagicBot 5c731894b1 Removed ordering junk 2024-03-18 14:03:42 -04:00
MagicBot 6ff26f6a25 Equipset reloaded after respawn 2024-03-18 13:29:09 -04:00
MagicBot b041326e23 Use correct serialization 2024-03-18 13:14:22 -04:00
MagicBot c8d355636b Only one item manager 2024-03-18 12:47:55 -04:00
MagicBot fa0dfadc8b Start mobequip refactor 2024-03-18 12:29:57 -04:00
MagicBot 8f7208ff34 Start mobequip refactor 2024-03-18 10:12:13 -04:00
MagicBot 61c4cb1361 Start mobequip refactor 2024-03-18 10:01:29 -04:00
MagicBot 0590ae64e7 Start mobequip refactor 2024-03-18 09:38:33 -04:00
MagicBot 7fa8c3bfff Drop chance added to item. 2024-03-18 09:18:51 -04:00
MagicBot 82c4e3169e Merge remote-tracking branch 'origin/unified-combat-manager' into feature-json7.3
# Conflicts:
#	src/engine/mobileAI/utilities/CombatUtilities.java
2024-03-18 08:03:10 -04:00
MagicBot 84f9d54ec0 Unused junk removed 2024-03-18 07:01:44 -04:00
MagicBot 3e71cf4b45 Unused junk removed 2024-03-18 06:57:39 -04:00
MagicBot 68b9651f94 Unused junk removed 2024-03-18 06:56:00 -04:00
MagicBot 50171e4600 TOL destroyed last in thread 2024-03-18 06:46:28 -04:00
FatBoy 9d7f2f39fe Unified Combat System 2024-03-17 15:56:47 -05:00
MagicBot a30c041a17 Logic update 2024-03-17 13:52:41 -04:00
MagicBot 756e20633f Warehouse deleted from db 2024-03-17 13:23:46 -04:00
MagicBot 12c1cde069 Warehouse deleted from db 2024-03-17 13:21:55 -04:00
MagicBot 2e0ffe67fa Overdraft method written 2024-03-17 12:26:57 -04:00
MagicBot 0c0f0aa54d Overdraft method written 2024-03-17 12:25:59 -04:00
MagicBot 538e452377 Sql update 2024-03-17 12:09:37 -04:00
MagicBot 264ce39552 Locks saved to disk 2024-03-17 11:55:00 -04:00
MagicBot b8bd71616b Setting city when loading 2024-03-17 11:45:18 -04:00
MagicBot b2f3e7a635 Building set on load 2024-03-17 11:36:26 -04:00
MagicBot e38324af63 Building set on load 2024-03-17 11:34:36 -04:00
MagicBot 5db5a26037 Warehouse loading work. 2024-03-17 11:29:30 -04:00
MagicBot 9b22287ede Warehouse loading work. 2024-03-17 11:10:47 -04:00
MagicBot 98c5b0e9ec Warehouse loading work. 2024-03-17 11:06:56 -04:00
MagicBot 0b74537bee Warehouse loading work. 2024-03-17 11:00:48 -04:00
MagicBot 5f930b0482 Warehouse loading work. 2024-03-17 10:52:33 -04:00
MagicBot aa0afa533d Duplicate key logic makes sense here. 2024-03-17 10:42:36 -04:00
MagicBot e06657e53f Loading of warehouse data 2024-03-17 10:06:26 -04:00
MagicBot a960e5ab04 Loading of warehouse data 2024-03-17 10:04:03 -04:00
MagicBot 4a9a496a5d Refactor warehouse part two. 2024-03-17 09:51:50 -04:00
MagicBot f3bfdd8a36 Refactor warehouse part two. 2024-03-17 09:47:00 -04:00
MagicBot b76a384e1f Refactor warehouse part two. 2024-03-17 09:01:35 -04:00
MagicBot 3c70a09e12 Itembase refactor work 2024-03-16 18:33:28 -04:00
MagicBot ee9b64285e Itembase refactor work 2024-03-16 18:31:21 -04:00
MagicBot 7848233396 equip slot usage update 2024-03-16 18:20:24 -04:00
MagicBot 2e05ba243f Itembase removed from interface 2024-03-16 18:06:12 -04:00
MagicBot b789c773b4 Refactor out itembase 2024-03-16 17:48:43 -04:00
MagicBot 023fd547fd Template passed to method 2024-03-16 17:46:49 -04:00
MagicBot 288c941d69 Merge remote-tracking branch 'origin/feature-json6' into featue-json7 2024-03-16 17:43:53 -04:00
MagicBot 6b2569873c bugfix: templateid wasn't being set 2024-03-16 17:24:17 -04:00
FatBoy 836c076884 removed ItemBase form Combat manager 2024-03-16 14:22:04 -05:00
MagicBot e4b0823911 Refactor of item.name; simplification. 2024-03-16 09:01:56 -04:00
MagicBot 3fdafe176b Refactor of item.name; simplification. 2024-03-16 08:56:22 -04:00
MagicBot c54b0470fa More itembase refactor 2024-03-16 08:33:21 -04:00
MagicBot ac2403362e Name simplification for collection 2024-03-16 07:57:17 -04:00
MagicBot 13bf6e6f5a SQL bugfix 2024-03-16 07:44:16 -04:00
MagicBot 131592090f Deed related values parsed 2024-03-16 07:41:16 -04:00
MagicBot 412fec17a6 Deed related fields parsed in template 2024-03-16 07:27:20 -04:00
MagicBot 995949c1ba Deed fields defined in template 2024-03-16 07:15:11 -04:00
MagicBot fce3fa8004 More itembase refactor work 2024-03-16 06:50:55 -04:00
MagicBot bb0803bf19 More itembase refactor work 2024-03-16 06:48:39 -04:00
MagicBot c091026114 More itembase refactor work 2024-03-16 06:47:05 -04:00
MagicBot c90461afe0 More itembase refactor work 2024-03-16 06:45:31 -04:00
MagicBot d9032f750f More itembase refactor work 2024-03-16 06:44:02 -04:00
MagicBot 55058b4ce1 String update 2024-03-16 06:41:48 -04:00
MagicBot 5ff19e58a5 DevCmd removed 2024-03-16 06:40:21 -04:00
MagicBot e831f447ae More itembace refactor work 2024-03-16 06:38:42 -04:00
MagicBot dd8699ad32 Bonus code removal 2024-03-15 13:41:44 -04:00
MagicBot 109ddde0a8 More itembase refactor work 2024-03-15 13:31:24 -04:00
MagicBot f78baf229d More itembase refactor work 2024-03-15 13:13:22 -04:00
MagicBot 22f498a6f8 More itembase refactor work 2024-03-15 13:06:21 -04:00
MagicBot ebaf68bca4 More itembase refactor work 2024-03-15 13:05:12 -04:00
MagicBot 8b98a3f2a1 More itembase refactor work 2024-03-15 11:50:36 -04:00
MagicBot d9549c227a More itembase refactor work 2024-03-15 11:47:44 -04:00
MagicBot c5c4c62208 Handler created for BuyFromNPCMsg 2024-03-15 11:37:07 -04:00
MagicBot 2ceaece7d9 More itembase refactor work 2024-03-15 11:30:03 -04:00
MagicBot b9b04c2b9f More itembase refactor work 2024-03-15 11:25:19 -04:00
MagicBot 789e177d67 More itembase refactor work 2024-03-15 11:20:32 -04:00
MagicBot 3168f12af1 More itembase refactor work 2024-03-15 10:59:23 -04:00
MagicBot e93f84d1c7 Method moved out of itembase db handler 2024-03-15 10:58:01 -04:00
MagicBot e323c80fba More refactor out itembase 2024-03-15 10:55:49 -04:00
MagicBot 57122e5b74 More refactor out itembase 2024-03-15 10:53:58 -04:00
MagicBot a1dbb42b4d More refactor itembase out of warehouse 2024-03-15 10:50:07 -04:00
MagicBot a489aecb86 More refactor itembase out of warehouse 2024-03-15 10:47:35 -04:00
MagicBot 6ed4faded2 Refactor out itembase 2024-03-15 10:35:41 -04:00
MagicBot f676b14351 Weight bugfix 2024-03-15 10:18:07 -04:00
MagicBot 97fa583f65 Initial warehouse refactor 2024-03-15 10:01:22 -04:00
MagicBot 92f53b00b8 Unused variables removed 2024-03-15 08:32:29 -04:00
MagicBot f2d28fd7af Refactored out duplicate db interface. 2024-03-14 15:22:38 -04:00
MagicBot 4646d03bdd Refactored out duplicate resource type. 2024-03-14 14:47:20 -04:00
MagicBot b6eb587a82 mine production added to type 2024-03-14 14:34:27 -04:00
MagicBot 9dd2a79be8 deposit limits use type lookup 2024-03-14 14:09:14 -04:00
MagicBot 2e37bd2472 deposit limits use type lookup 2024-03-14 13:58:51 -04:00
MagicBot f9797a38b8 deposit limits added to type 2024-03-14 13:48:36 -04:00
MagicBot 20a42ab3e5 isConsumable not used as driven by switch. 2024-03-14 07:37:34 -04:00
MagicBot a7062eff3a isConsumable not used as driven by switch. 2024-03-14 07:36:36 -04:00
MagicBot 6806ae3dc0 isConsumable not used as driven by switch. 2024-03-14 07:35:13 -04:00
MagicBot b665d46dc3 Methods moved to better class. 2024-03-13 14:11:53 -04:00
MagicBot 0b68ae3960 Resource.hash refactored 2024-03-11 17:10:34 -04:00
MagicBot ef38e93c11 Refactor of animations 2024-03-11 15:44:31 -04:00
MagicBot 4f7c34aec9 Refactor out item useID 2024-03-11 12:24:28 -04:00
MagicBot 7595f7dfb5 Refactor out item useID 2024-03-11 12:17:36 -04:00
MagicBot 96b4e1c639 Refactor out item useID 2024-03-11 12:07:46 -04:00
MagicBot efab8eefba Refactor baked in stats 2024-03-11 11:33:53 -04:00
MagicBot b0f8c758e5 Refactor baked in stats 2024-03-11 11:29:41 -04:00
MagicBot 6ee194924c Refactor baked in stats 2024-03-11 11:24:19 -04:00
MagicBot 784767dc4e Logic cleanup 2024-03-11 01:01:51 -04:00
MagicBot 15d2f2b9d8 Refactor boon handling 2024-03-11 00:53:14 -04:00
MagicBot 56b89b7080 Refactor isTwoHanded() 2024-03-10 16:21:23 -04:00
MagicBot 32d9322189 Table renamed to static_item_templates 2024-03-10 16:14:18 -04:00
MagicBot ca8c4338b2 Junk removal 2024-03-10 16:07:12 -04:00
MagicBot 6a4a550f63 Junk removal 2024-03-10 16:01:29 -04:00
FatBoy 24d5fb2259 checkf o valid slot type when equipping item 2024-03-10 14:33:59 -05:00
FatBoy f3d4a2becc Merge remote-tracking branch 'origin/feature-json6' into feature-json6 2024-03-10 14:33:31 -05:00
FatBoy e1018a48f0 checkf o valid slot type when equipping item 2024-03-10 14:32:50 -05:00
MagicBot 50d75eecc6 Pass weaponslot not slot. 2024-03-10 15:21:35 -04:00
MagicBot 406c864b17 Exclude Cloth for now 2024-03-10 14:53:14 -04:00
MagicBot f616937236 Refactor skill_used 2024-03-10 14:10:51 -04:00
MagicBot e47bd6fba0 Templates needed now on login server. 2024-03-10 13:45:34 -04:00
MagicBot 7f830a18cd Error logging addded 2024-03-10 13:42:25 -04:00
MagicBot 7bf5279ad3 Needs mbeditor-pro update 2024-03-10 13:38:50 -04:00
MagicBot df5c607375 Refactor item_type 2024-03-10 13:34:24 -04:00
MagicBot 87290baa52 More junk removal 2024-03-10 12:33:33 -04:00
MagicBot 8bf47fb4fe More junk removal 2024-03-10 07:32:30 -04:00
MagicBot b20de1657c More junk removal 2024-03-10 07:27:20 -04:00
MagicBot a5af5d9ec8 More junk removal 2024-03-10 07:26:28 -04:00
MagicBot b3bffed179 restrictflag and junk removal 2024-03-10 07:25:05 -04:00
MagicBot f349e0dda8 IsArmor junk removal 2024-03-10 07:21:34 -04:00
MagicBot 76d723669a AudiID junk removal 2024-03-10 07:19:11 -04:00
MagicBot 5537934f88 Moved method in class. 2024-03-09 12:28:49 -05:00
MagicBot e2aa7b54a4 One like shield check. 2024-03-09 11:46:58 -05:00
MagicBot 6f028ab8c8 Refactored isShield and removed equipflag. 2024-03-09 11:26:19 -05:00
MagicBot 658b442b36 Logic cleanup 2024-03-09 09:55:00 -05:00
MagicBot f6fbc6fecb Logic cleanup 2024-03-09 09:30:58 -05:00
MagicBot c6f451bce1 Remove from equip before changing slot. 2024-03-09 09:09:17 -05:00
MagicBot 3500bf0ede Handler created for equip to inventory message. 2024-03-09 08:04:17 -05:00
MagicBot 04d9b76938 More ordinal refactor 2024-03-09 07:41:59 -05:00
MagicBot 68088a3399 more equip refactored. 2024-03-09 07:05:48 -05:00
MagicBot 20cb8ef94d Handler created for equip message. 2024-03-08 13:39:38 -05:00
MagicBot caf708bed6 Handler created for equip message. 2024-03-08 13:31:18 -05:00
MagicBot 75691aaab9 Handler created for equip message. 2024-03-08 13:29:52 -05:00
MagicBot 83e8a8a218 Bugfix in parm type 2024-03-08 13:07:06 -05:00
MagicBot a9dc7b1c5b Equipment slot refactor started. 2024-03-08 12:46:20 -05:00
MagicBot d8d017669a Equipment slot refactor started. 2024-03-08 12:19:57 -05:00
MagicBot 7d1d8891ff Uppercasew for resist enum 2024-03-08 10:21:31 -05:00
MagicBot ffdf374cd6 Item requirements and restrictions refactored. 2024-03-08 10:08:25 -05:00
MagicBot 54b7fc2212 Parse offering info. 2024-03-07 20:40:32 -05:00
MagicBot 5476d238fa Parse offering info. 2024-03-07 20:39:31 -05:00
MagicBot 8e85136dc5 Parse offering info. 2024-03-07 20:32:35 -05:00
MagicBot 82daff3b6e Unused variable. 2024-03-07 20:18:16 -05:00
MagicBot 642270aacf Helper method created 2024-03-07 09:30:13 -05:00
MagicBot 3048f86f5b item physical resists refactored 2024-03-06 14:53:17 -05:00
MagicBot 84e74c5052 Refactored out character skill enum. 2024-03-06 14:36:25 -05:00
MagicBot 4dc0f52295 item_wt refactored to template 2024-03-03 15:06:44 -05:00
MagicBot 58652ee32f Template id assigned in constructor. 2024-03-03 14:03:20 -05:00
MagicBot 1a4d888304 Templates need to exist on Login server. 2024-03-03 13:36:12 -05:00
MagicBot f11fcc535a item_value refactored to template 2024-03-03 13:18:16 -05:00
MagicBot 70f331d025 item_value refactored to template 2024-03-03 13:06:05 -05:00
MagicBot 8a1cd316fe Durability and initial charges migrated to template. 2024-03-03 08:48:38 -05:00
MagicBot d7dfab5e74 Durability and initial charges migrated to template. 2024-03-03 08:38:24 -05:00
MagicBot 436d0cec9b Bonus code removed. 2024-03-03 08:12:49 -05:00
MagicBot 266e4214d4 Itembase refactored out. 2024-03-03 08:05:36 -05:00
MagicBot 08aa431f5d More item refactor work. 2024-03-02 11:11:24 -05:00
MagicBot b98e7cda15 More item refactor work. 2024-03-02 11:07:07 -05:00
MagicBot d05dbef71d More item refactor work. 2024-03-02 10:52:20 -05:00
MagicBot 5736f0a7a3 More item refactor work. 2024-03-02 10:34:45 -05:00
MagicBot ec90ef6174 items PERSIST work. 2024-03-02 09:55:30 -05:00
MagicBot fa440e2885 Begin constructor refactor 2024-03-01 21:32:51 -05:00
MagicBot 9ea44d7e1c Begin constructor refactor 2024-03-01 16:38:20 -05:00
MagicBot 22326802b3 Begin constructor refactor 2024-03-01 16:28:28 -05:00
MagicBot 531662e012 Unused item constructor removed. 2024-03-01 15:59:42 -05:00
MagicBot 8eaaabb4d4 Formatting cleanup 2024-03-01 08:31:49 -05:00
MagicBot 37af60781d Template id back-filled when created. 2024-03-01 08:23:28 -05:00
MagicBot 29c68110cf Refactor out itembase 2024-03-01 08:20:34 -05:00
MagicBot 1306ea3c5c Logging null templates 2024-02-28 17:41:48 -05:00
MagicBot 527acb8e52 Removed temp logging 2024-02-28 17:33:28 -05:00
MagicBot 744b508fea Logging missing base names 2024-02-28 17:31:59 -05:00
MagicBot ea97eb56a6 Logging missing base names 2024-02-28 17:30:41 -05:00
MagicBot 8d91f200e7 Refactor itembase.name to template. 2024-02-28 16:42:07 -05:00
MagicBot d9775dbf4e Refactor itembase.name to template. 2024-02-28 16:31:09 -05:00
MagicBot 507769c6b6 item_takeable parsed. 2024-02-28 14:59:17 -05:00
MagicBot aae9e38f36 Redundant comment 2024-02-27 16:44:21 -05:00
MagicBot 2cd3d028a9 Parsing resource costs 2024-02-27 16:38:10 -05:00
MagicBot c5bb051e64 Parsing resource costs 2024-02-27 16:35:36 -05:00
MagicBot 6a33651782 More parsing work. 2024-02-27 15:47:04 -05:00
MagicBot 1d2e4bbda7 More parsing work. 2024-02-27 15:44:08 -05:00
MagicBot f1a8f6024d Bugfix array index 2024-02-27 15:42:12 -05:00
MagicBot 0829a60f35 More parsing work 2024-02-27 15:40:55 -05:00
MagicBot f39434a248 More parsing work 2024-02-27 15:36:18 -05:00
MagicBot 808a60c86c More parsing work 2024-02-27 15:35:03 -05:00
MagicBot 22da19085d More parsing work 2024-02-27 15:16:38 -05:00
MagicBot 5304919e2a More parsing work 2024-02-27 15:16:18 -05:00
MagicBot 093fe0f261 More parsing work 2024-02-27 14:53:06 -05:00
MagicBot ab32ad1538 More parsing work 2024-02-27 14:52:07 -05:00
MagicBot 0a39102b08 More parsing work 2024-02-27 14:50:38 -05:00
MagicBot 91247c58a6 More parsing work 2024-02-27 14:48:55 -05:00
MagicBot bcf4aef5a0 More parsing work 2024-02-27 14:42:35 -05:00
MagicBot ffd248cfd4 Parse animation data 2024-02-27 14:36:27 -05:00
MagicBot 2d3b74e688 More parsing work. 2024-02-27 14:14:16 -05:00
MagicBot db94673256 More parsing work. 2024-02-27 14:05:57 -05:00
MagicBot 4d118cf634 More parsing work. 2024-02-27 13:55:26 -05:00
MagicBot e464f30445 Parsing grants 2024-02-27 13:48:21 -05:00
MagicBot 67e4011c65 Parsing grants 2024-02-27 13:47:50 -05:00
MagicBot 839be1f28f Always check for empty arrays. For loop processes them. 2024-02-27 13:31:11 -05:00
MagicBot 8ae4a67635 Refactor to array. 2024-02-27 13:19:24 -05:00
MagicBot e228ff8715 Parsing power actions. 2024-02-27 13:06:14 -05:00
MagicBot c4a4a8659a More parsing work. 2024-02-27 12:51:14 -05:00
MagicBot b26134ec72 Support for multiple damage type entries. 2024-02-27 12:21:18 -05:00
MagicBot 8656d6bfb9 New branch more progress 2024-02-26 21:09:57 -05:00
MagicBot 2ffd354f38 Logging null building 2024-02-26 15:52:49 -05:00
MagicBot 441b2fe42a Logging null building 2024-02-26 15:49:45 -05:00
MagicBot 2885457ea6 toUppercase() 2024-02-26 15:30:16 -05:00
MagicBot 1763266972 toUppercase() 2024-02-26 15:18:03 -05:00
MagicBot 2e5fa69942 Uppercase enum. 2024-02-26 15:12:23 -05:00
MagicBot e1e9bc026a Case fix in json 2024-02-26 04:37:07 -05:00
MagicBot 74d5ab7fea Removed string override 2024-02-26 04:24:35 -05:00
MagicBot e8e84e00af Merge Damage and Source types. 2024-02-26 03:44:51 -05:00
MagicBot a7b3fba018 Def rating is an int 2024-02-26 03:10:11 -05:00
MagicBot 5cdf1d5599 Weapon field parsing 2024-02-24 15:45:22 -05:00
MagicBot e6dd2b22d8 Weapon field parsing 2024-02-24 15:41:48 -05:00
MagicBot df6c3addcf Weapon field parsing 2024-02-24 15:37:59 -05:00
MagicBot e9d5c3db0e Weapon field parsing 2024-02-24 15:34:16 -05:00
MagicBot 36f12f9c97 Weapon field parsing 2024-02-24 15:32:45 -05:00
MagicBot 55213c409b Weapon field parsing 2024-02-24 15:31:18 -05:00
MagicBot d9474afa34 Weapon field parsing 2024-02-24 15:30:12 -05:00
MagicBot 9c8b690739 Weapon field parsing 2024-02-24 15:28:21 -05:00
MagicBot d20a2129aa Weapon field parsing 2024-02-24 15:25:06 -05:00
MagicBot 704375099b Wrapped in armor test 2024-02-24 14:52:52 -05:00
MagicBot bf9ac7accb Test code removed 2024-02-24 14:40:51 -05:00
MagicBot b2cf15139a Testing 2024-02-24 14:39:48 -05:00
MagicBot 4352e95f82 remove - for half-giant 2024-02-24 14:33:59 -05:00
MagicBot fb7a98761f Parsing discs 2024-02-24 14:31:08 -05:00
MagicBot 5d0f79892c Parsing discs 2024-02-24 14:29:39 -05:00
MagicBot d3f9b53810 Parsing discs 2024-02-24 14:28:28 -05:00
MagicBot 7632dc783a Parsing classes 2024-02-24 14:24:51 -05:00
MagicBot 61f28a588b Parsing classes 2024-02-24 14:24:02 -05:00
MagicBot e448c9a0d3 Parsing races 2024-02-24 14:16:01 -05:00
MagicBot 155bbfbf4e Parsing races 2024-02-24 14:12:16 -05:00
MagicBot cf0b9a0ae0 Bugfix in variable name. "None" support. 2024-02-24 13:54:16 -05:00
MagicBot 2b65e23b48 Enumeration updated. 2024-02-24 09:11:17 -05:00
MagicBot d363a9fc1b Try Catch 2024-02-24 09:07:05 -05:00
MagicBot a99b0072e0 Parsing cleanup 2024-02-24 09:04:27 -05:00
MagicBot f940d05d12 Parsing cleanup 2024-02-24 08:48:03 -05:00
MagicBot 8d80e0a46e Parsing cleanup 2024-02-24 08:45:44 -05:00
MagicBot 37fec69462 Parsing cleanup 2024-02-24 08:42:19 -05:00
MagicBot 09a196149e Parsing skill required. 2024-02-24 08:32:05 -05:00
MagicBot bb8e8780bd More parser work. 2024-02-24 08:01:22 -05:00
MagicBot bade2162a6 More parser work. 2024-02-24 07:49:13 -05:00
MagicBot 4e2578f3e0 Reworked CharacterSkill enum. 2024-02-23 11:58:56 -05:00
MagicBot 62e13ade01 String cleanup for skill enums. 2024-02-19 03:58:43 -05:00
MagicBot acea3875a1 String cleanup for skill enums. 2024-02-19 03:54:47 -05:00
MagicBot 354f10ddee Debug code removed 2024-02-19 03:50:50 -05:00
MagicBot 5e6d298ca0 Skills and mastery work. 2024-02-19 03:50:26 -05:00
MagicBot 9019b0ad29 Type selection work. 2024-02-19 03:16:36 -05:00
MagicBot b2112f2b01 Type selection work. 2024-02-19 03:06:38 -05:00
MagicBot 9e652761b8 Type selection work. 2024-02-19 03:04:12 -05:00
MagicBot fe54085cc6 Handler easier to debug. 2024-02-19 02:51:26 -05:00
MagicBot ef05e5c524 Skill and mastery work. 2024-02-19 02:41:25 -05:00
MagicBot d11c6988cc Skill and mastery work. 2024-02-19 02:40:59 -05:00
MagicBot 39de8439ba File reformat 2024-02-19 02:27:19 -05:00
MagicBot 15635534b0 Type enum with back support 2024-02-19 02:25:25 -05:00
MagicBot 5b547611a5 Starting work on type. 2024-02-19 01:58:27 -05:00
MagicBot 11e6b793d5 More constructor work. 2024-02-18 15:15:19 -05:00
MagicBot b9507381ed More constructor work. 2024-02-18 15:05:54 -05:00
MagicBot 3bd50a1ad1 More constructor work. 2024-02-18 14:58:50 -05:00
MagicBot e6452955b6 More constructor work. 2024-02-18 14:54:34 -05:00
MagicBot 14397d1550 More constructor work. 2024-02-18 14:41:34 -05:00
MagicBot 8267cbd8f0 More constructor work. 2024-02-18 14:30:20 -05:00
MagicBot 1ff2dc6733 More constructor work. 2024-02-18 14:29:56 -05:00
MagicBot 04d88d0523 More constructor work. 2024-02-18 14:25:28 -05:00
MagicBot 5e8b4e0e61 Parsing enumsets for eq slots 2024-02-18 14:17:11 -05:00
MagicBot 151230c611 Enum in client has a NONE type 2024-02-18 14:12:39 -05:00
MagicBot 52750e6d6b Fleshing out constructor 2024-02-18 14:08:45 -05:00
MagicBot 8ff112b802 Fleshing out constructor 2024-02-18 14:03:41 -05:00
MagicBot 88516d2857 Fleshing out constructor 2024-02-18 13:40:16 -05:00
MagicBot 9bf7c088cf Fleshing out constructor 2024-02-18 13:29:01 -05:00
MagicBot b0542a5bc3 Fleshing out constructor 2024-02-18 12:35:55 -05:00
MagicBot ac06e7723f Fleshing out constructor 2024-02-18 12:30:23 -05:00
MagicBot 12608d8d32 Fleshing out constructor 2024-02-18 12:28:14 -05:00
MagicBot 8018f1323d Fleshing out constructor 2024-02-18 12:26:39 -05:00
MagicBot 90874b01a7 Fleshing out constructor 2024-02-18 12:26:11 -05:00
MagicBot 6685fc9b02 Fleshing out constructor 2024-02-18 12:15:13 -05:00
MagicBot ad52546e0c Fleshing out constructor 2024-02-18 12:04:41 -05:00
MagicBot 2518b1421c Fleshing out constructor 2024-02-18 11:59:23 -05:00
MagicBot 551418c293 Fleshing out constructor 2024-02-18 11:58:39 -05:00
MagicBot 524ebbbdd7 Fleshing out constructor 2024-02-18 11:55:45 -05:00
MagicBot 40d0e765fe Fleshing out constructor 2024-02-18 11:49:24 -05:00
MagicBot 53b2f476e2 Fleshing out constructor 2024-02-18 11:41:24 -05:00
MagicBot d6a952f182 Fleshing out constructor 2024-02-18 11:39:11 -05:00
MagicBot 4eff5ad84e Data loaded at bootstrap. 2024-02-18 11:12:54 -05:00
MagicBot 0d93850813 dbHandler created 2024-02-18 11:08:46 -05:00
MagicBot 129eb1b818 Local cache defined. 2024-02-18 11:00:56 -05:00
MagicBot 0d8b8504b4 itemTemplate created 2024-02-18 10:54:49 -05:00
MagicBot a8cd6f4f74 Merge remote-tracking branch 'origin/feature-lore-ruleset' into magicbox-1.5.2 2024-02-18 08:27:30 -05:00
MagicBot d1f8e0a97e Merge remote-tracking branch 'origin/feature-server-restrictions' into feature-lore-ruleset 2024-02-18 08:26:27 -05:00
MagicBot c0a7ddc711 Using a string instead of a set. 2024-02-18 08:20:34 -05:00
FatBoy c80b9013d2 Lore Rules 2024-02-15 19:46:41 -06:00
FatBoy c1de1f148b dev command for item requirement info 2024-02-15 18:47:43 -06:00
MagicBot f36e2f19b8 MB_RULESET config entry added 2024-02-15 11:31:22 -05:00
MagicBot d46b2dc298 File reformat. 2024-02-14 12:29:42 -05:00
FatBoy 6c1e2f1280 implement server side restrictions 2024-02-13 21:01:09 -06:00
FatBoy f952785c8e implement server side restrictions 2024-02-13 20:46:28 -06:00
FatBoy 8a769c60f2 implement server side restrictions 2024-02-13 20:35:25 -06:00
MagicBot 7fcbfba7e0 Case fix in elements 2024-02-11 08:35:03 -05:00
MagicBot 9be32a3ebf Case fix in elements 2024-02-11 08:34:05 -05:00
MagicBot cc8f817006 Generics lose type information 2024-02-11 08:31:38 -05:00
MagicBot 8f88da6016 Error handling for parsing of enum 2024-02-11 08:27:48 -05:00
MagicBot 4f441340ea Error handling for parsing of enum 2024-02-11 08:25:11 -05:00
MagicBot 6259cd7803 Error handling for parsing of enum 2024-02-11 08:23:01 -05:00
MagicBot 608324c500 Updated rs constructor to use new enumset system. 2024-02-11 08:15:31 -05:00
MagicBot 42362dca90 Method cleanup 2024-02-11 08:12:18 -05:00
MagicBot 20bebafc89 Tweak to string cleanup. 2024-02-11 08:09:31 -05:00
MagicBot bd2547046a Early exit on empty sets. 2024-02-11 08:07:22 -05:00
MagicBot 3666331de8 Column name fix 2024-02-11 08:04:03 -05:00
MagicBot dc6bce6f53 Testing of new helper at bootstrap. 2024-02-11 08:01:42 -05:00
MagicBot 5e1ebeb4df Enumset helper created 2024-02-11 07:55:38 -05:00
MagicBot e1e722f09f Remove old loader in preb for refactor 2024-02-11 07:29:42 -05:00
FatBoy 4988f92d03 r8 mesh lookup changed location 2024-02-10 22:14:52 -06:00
FatBoy e95005199c update r8 mesh 2024-02-10 21:45:57 -06:00
MagicBot e05d0d8daa promote type upgraded to class type. 2024-02-10 13:13:11 -05:00
MagicBot 141a65d48e Discripline type enum created 2024-02-10 10:39:25 -05:00
MagicBot d2cbfd491a Devcmd output cleanup 2024-02-09 14:10:28 -05:00
MagicBot 5f71ff2db5 Removed unused handlers. 2024-02-09 13:51:13 -05:00
MagicBot 2ea38519e4 charter sex requirements added 2024-02-09 13:48:15 -05:00
MagicBot 4fac0c3921 charter class requirements added 2024-02-09 13:42:30 -05:00
MagicBot 6a021f938d charter class enum completed. 2024-02-09 12:00:33 -05:00
MagicBot 544e715905 Enumset partial update. 2024-02-08 13:59:40 -05:00
MagicBot b3b6a9a913 Class requirements refactored to enumset. 2024-02-08 13:11:37 -05:00
FatBoy d487a9d1ab server side race/cass restrictions 2024-02-07 19:51:58 -06:00
FatBoy 28bf0413cc server side race/cass restrictions 2024-02-07 19:44:33 -06:00
FatBoy 0e44293231 server side race/cass restrictions 2024-02-07 19:43:04 -06:00
FatBoy 45a0747176 server side race/cass restrictions 2024-02-07 19:35:56 -06:00
FatBoy 7e29ecde9b server side race/cass restrictions 2024-02-07 19:33:37 -06:00
FatBoy 8000d523f1 server side race/cass restrictions 2024-02-07 19:28:18 -06:00
FatBoy ca09587d87 server side race/cass restrictions 2024-02-07 19:25:48 -06:00
FatBoy 726d68df31 server side race/cass restrictions 2024-02-07 19:20:29 -06:00
MagicBot 250e3407fa Merge remote-tracking branch 'origin/bugfix-safeguard-aggro' into magicbox-1.5.2 2024-01-29 12:31:26 -05:00
MagicBot fcd37cbae2 Dev cmd cleanup 2024-01-28 11:30:54 -05:00
MagicBot 70e76d9a1a Handling of mobs not in buildings. 2024-01-28 11:26:54 -05:00
MagicBot 6a3bd89095 Handling of mobs not in buildings. 2024-01-28 11:24:20 -05:00
MagicBot 4ccf03dfd3 Zone offset not world loc. 2024-01-28 10:31:02 -05:00
MagicBot f845c0ad80 Better handling of null guilds. 2024-01-28 10:15:55 -05:00
MagicBot 165752f6d6 Null fix in dev command. 2024-01-28 10:01:01 -05:00
FatBoy c0ee8b82f8 Warehosue cleanup 2024-01-24 20:21:41 -06:00
FatBoy cc1e0d8986 Warehosue cleanup 2024-01-24 20:03:27 -06:00
FatBoy 7f6fbd2bff load mesh data and structure meshes 2024-01-24 19:03:33 -06:00
MagicBot 92d8ed9e3f Empty map supplied by the lookup method. 2024-01-15 07:38:43 -05:00
MagicBot 45b2443982 Log failed equipSet lookups. 2024-01-15 07:37:35 -05:00
MagicBot 3775fb336b Null check was done previously. 2024-01-15 06:44:33 -05:00
MagicBot f7a8ca33fc Zone size derived from template. 2024-01-09 12:55:08 -05:00
MagicBot c45265b085 Error trap added 2024-01-04 13:59:13 -05:00
MagicBot 79400b6b0e Error trap when deranking during maintenance. 2024-01-04 13:51:57 -05:00
MagicBot 2bff826a10 Error trap when deranking during maintenance. 2024-01-04 13:51:15 -05:00
MagicBot d5fc87c233 Update to player city size handling. 2024-01-04 12:43:30 -05:00
MagicBot 78a0416b19 Updated city planting to conform to class refactor project. 2023-12-24 09:44:01 -05:00
MagicBot eb5bc14974 Revert needs new branch. 2023-11-12 11:21:30 -05:00
MagicBot 7e99e8c7a4 Height and width flipped. 2023-11-12 11:13:27 -05:00
MagicBot 9b0f4d5aef Height and width flipped. 2023-11-12 11:09:29 -05:00
MagicBot b58049968f IDA says 256. 2023-11-12 07:36:56 -05:00
MagicBot 9bf0d3f7d1 Devcmd updated. 2023-11-11 07:10:46 -05:00
MagicBot 8300c47e4a Dev cmd updated 2023-11-08 11:59:52 -05:00
MagicBot c73fcc19f2 Dev cmd updated 2023-11-08 11:34:33 -05:00
MagicBot f93573177a Dev cmd updated 2023-11-08 11:27:44 -05:00
MagicBot fe9c6437d8 Dev cmd updated 2023-11-08 11:27:36 -05:00
MagicBot c110ffc4b1 Dev cmd updated 2023-11-02 09:08:28 -04:00
MagicBot 7af63d1519 Nominal after test. 2023-10-25 13:51:54 -04:00
MagicBot 31ba1f2c4c Height from zone center. 2023-10-25 13:46:08 -04:00
MagicBot 33afd13a8c Height from zone center. 2023-10-25 13:36:26 -04:00
MagicBot b341ffacbf Devcmd updated 2023-10-25 13:12:02 -04:00
MagicBot 0d1d1f0f37 Added raw blend value to class 2023-10-25 13:01:21 -04:00
MagicBot 3f59ed48d2 Extra parens removed 2023-10-23 14:13:06 -04:00
MagicBot de832ff497 Long cast needed 2023-10-23 14:12:59 -04:00
MagicBot 1aef82f422 Cleanup work. 2023-10-23 00:43:23 -04:00
MagicBot 065a1c9ceb Cleanup work. 2023-10-23 00:39:12 -04:00
MagicBot ff219ce696 Respawn thread configured 2023-10-23 00:32:59 -04:00
MagicBot 8bd406bcf4 Mobile implements Delayed interface 2023-10-23 00:07:48 -04:00
MagicBot 7b70b680f0 Modified sequencing 2023-10-22 12:29:52 -04:00
MagicBot c3586a70fd Modified sequencing 2023-10-22 12:15:48 -04:00
MagicBot cc7d741681 Modified sequencing 2023-10-22 12:05:06 -04:00
MagicBot ce0dfdabfb Zones with zero blend inherit from parent 2023-10-22 11:48:15 -04:00
MagicBot 737327fa8a Revert after test 2023-10-20 17:52:23 -04:00
MagicBot b1e79284e4 Thread count test 2023-10-20 17:49:29 -04:00
MagicBot 29b5955e9e Peace zone needs to come from zone tree 2023-10-20 17:33:53 -04:00
MagicBot 3986dc0686 Peace zone needs to come from zone tree 2023-10-20 17:22:57 -04:00
MagicBot 59190e33c9 Template added for player cities (0) 2023-10-20 17:09:27 -04:00
MagicBot 091b1a1d5b Start refactor to use templates 2023-10-20 17:01:42 -04:00
MagicBot cb0ba901de fix in column name 2023-10-20 16:37:42 -04:00
MagicBot 14ba9d0f7f SQL statement set. 2023-10-20 16:36:08 -04:00
MagicBot ec9bc437f3 Templates loaded at bootstrap 2023-10-20 16:33:33 -04:00
MagicBot 930aa73657 rs constructor completed 2023-10-20 16:30:41 -04:00
MagicBot cf2bf2dacf DBhandler created for templates 2023-10-20 16:11:55 -04:00
MagicBot 5a8508c16c Template collection created 2023-10-20 15:50:04 -04:00
MagicBot 5bcc0ed84d Template class created 2023-10-20 15:42:06 -04:00
MagicBot 4795a315ad Template now templteID to make room for the actual template. 2023-10-20 15:20:30 -04:00
MagicBot 6559f232a3 Dev command updated 2023-10-20 10:08:39 -04:00
MagicBot db8b33a621 No longer pre-cache players 2023-10-20 09:58:47 -04:00
MagicBot 781a4ee16d Load cities after buildings 2023-10-20 09:50:48 -04:00
MagicBot 7ce94a5166 should never pull directly form cache 2023-10-20 09:48:24 -04:00
MagicBot a487a7bd2f Removed duplicate and unused code 2023-10-20 09:41:24 -04:00
MagicBot f0fedcc049 Cleanup and reformat 2023-10-20 09:39:05 -04:00
MagicBot 3a63f98ac3 Error log added 2023-10-20 08:09:42 -04:00
MagicBot 4c994e6e55 Removed old method 2023-10-20 08:06:40 -04:00
MagicBot 1c93846ed3 Full error is output 2023-10-19 17:01:26 -04:00
MagicBot 3ef444c128 Cleanup in runafterload 2023-10-19 16:53:15 -04:00
MagicBot eaaba8ab0c Refactored assignment. 2023-10-19 16:48:39 -04:00
MagicBot 1daa45d604 New collection utilized 2023-10-19 16:44:29 -04:00
MagicBot cf7e19bfde Patrol points loaded 2023-10-19 16:24:18 -04:00
MagicBot 6a76cc7a29 Patrol points loaded 2023-10-19 16:20:43 -04:00
MagicBot fff16d2211 Comment cleanup 2023-10-19 16:10:53 -04:00
MagicBot a2df7cda22 Inlined populate world method 2023-10-19 08:47:28 -04:00
MagicBot 5858fa4de4 R8 bonus application moved to City 2023-10-19 08:20:28 -04:00
MagicBot fb6ec0caf4 Changed method used to direct bounds 2023-10-19 08:15:32 -04:00
MagicBot 944bcb7e84 Changed method used to direct bounds 2023-10-19 08:15:22 -04:00
MagicBot 4274e6a148 Cleanup of friend and condemned initialization. 2023-10-19 07:59:44 -04:00
FatBoy 5e629e7890 null checks for Building.getFriends() 2023-10-18 20:50:47 -05:00
FatBoy e991a01b50 final touch up 2023-10-18 20:21:26 -05:00
FatBoy 7a1700cec3 finalized 2023-10-18 20:17:26 -05:00
FatBoy 79eb5b9cdf stairs region corrected 2023-10-18 20:03:41 -05:00
FatBoy 7886aa6041 building and region lookup completed 2023-10-18 18:45:50 -05:00
FatBoy b928bedeb6 new region lookup 2023-10-18 18:23:14 -05:00
MagicBot beb2b47162 Collection used and old method deleted. 2023-10-18 13:03:40 -04:00
MagicBot 2cc37481ca New collection created in handled and loaded from db 2023-10-18 12:54:06 -04:00
MagicBot 5ac62d60be Collection used and old handler removed. 2023-10-18 12:38:04 -04:00
MagicBot 6fb1e2e5f1 Load collection from db 2023-10-18 12:31:39 -04:00
MagicBot 385695a610 Load collection from db 2023-10-18 12:24:32 -04:00
MagicBot 838776c471 Method made static and moved to manager. 2023-10-18 11:30:22 -04:00
MagicBot 44743b772b Every building does not need a rebuild mine method. 2023-10-18 11:21:29 -04:00
MagicBot 88f67efd51 Want to fail fast here 2023-10-18 11:04:57 -04:00
MagicBot a04bdc147f Parent zone set 2023-10-18 11:03:08 -04:00
MagicBot 145d9bafa0 Removed unused methods 2023-10-18 10:59:50 -04:00
MagicBot d2c00cce70 Removed unused methods 2023-10-18 10:38:55 -04:00
MagicBot 602f8bc843 Cleanup building initialization 2023-10-18 10:33:58 -04:00
MagicBot 89cb808481 Removed old handlers 2023-10-18 10:23:35 -04:00
MagicBot 4d290c9064 Refactored city planting to use new system. 2023-10-18 09:38:19 -04:00
MagicBot 9ee60c9361 Refactored Zone to new system 2023-10-18 09:24:56 -04:00
MagicBot 77cc91319a Refactored Zone to new system 2023-10-18 09:22:54 -04:00
MagicBot ee4009bf8d Refactored Zone to new system 2023-10-18 09:13:11 -04:00
MagicBot ff1c0bd347 Refactored Zone to new system 2023-10-18 09:08:41 -04:00
MagicBot e1add3c7e6 Refactored Zone to new system 2023-10-18 08:51:46 -04:00
MagicBot bf06734a9b Refactored Zone to new system 2023-10-18 08:42:40 -04:00
MagicBot 5ed21f9b76 Refactored Zone to new system 2023-10-18 08:33:49 -04:00
MagicBot e689cb541a Refactored Zone to new system 2023-10-18 08:25:05 -04:00
MagicBot da32765902 Change to AWO 2023-10-18 08:03:47 -04:00
MagicBot 9392ceda61 Comment cleanup 2023-10-17 17:07:52 -04:00
MagicBot 694b10d3b2 Begin refactor of cities 2023-10-17 16:32:36 -04:00
MagicBot 6b3c64faea Minions loaded for guard captain 2023-10-17 15:09:42 -04:00
MagicBot ab17dd08cd Refactor towards new bootstrap system. 2023-10-17 14:52:13 -04:00
MagicBot f889bcf927 Building handler added 2023-10-17 14:43:28 -04:00
MagicBot 34024c9fb4 New handlers created 2023-10-17 08:45:33 -04:00
MagicBot 9d5e16aa5c Removed debug command 2023-10-17 08:28:18 -04:00
MagicBot f1a2bea67c Pixel values are shorts for memory 2023-10-17 07:56:31 -04:00
FatBoy 5d4192bbcf add offset for runegate teleport regions 2023-10-16 19:56:08 -05:00
FatBoy ea6ea4b0ee teleport work 2023-10-16 19:07:34 -05:00
FatBoy 7f4d47505e teleport cleanup 2023-10-16 18:46:44 -05:00
FatBoy f9a3b17677 teleport cleanup 2023-10-16 15:10:09 -05:00
FatBoy d0374a2dea random delay between mob chase 2023-10-16 15:07:39 -05:00
FatBoy cb89cc17be update lastChase timestamp for mobs 2023-10-16 14:37:17 -05:00
FatBoy d506807a8f 1 second delay for mobs chasing target 2023-10-16 14:33:09 -05:00
FatBoy 1a0fc309f9 remove mob movement delay 2023-10-16 14:23:18 -05:00
FatBoy 5ed7662798 1 second delay for mob movements 2023-10-16 14:13:33 -05:00
FatBoy e3d6a32554 1 second delay for mob movements 2023-10-16 14:02:48 -05:00
FatBoy 6f990d488f region assignment in AbstractCharacter.setLoc 2023-10-16 13:41:18 -05:00
MagicBot 610de198e9 All 0 heightmap for PLANAR 2023-10-15 17:39:02 -04:00
MagicBot 928be0facb Named for context 2023-10-15 17:28:20 -04:00
MagicBot 80799753be Comment cleanup 2023-10-15 17:23:16 -04:00
MagicBot f9d2232a9b Comment cleanup 2023-10-15 17:22:05 -04:00
MagicBot cbd8685d4b Guild zone performance tweak 2023-10-15 16:46:48 -04:00
MagicBot 274cf08dad Comment cleanup 2023-10-15 16:43:20 -04:00
MagicBot 2cbe5f38cd Configuration moved to constructor 2023-10-15 16:40:31 -04:00
MagicBot 3d4058ad01 Height for seafloor 2023-10-15 15:57:58 -04:00
MagicBot 761ec6f4af Blend test 2023-10-15 14:55:19 -04:00
MagicBot 5900068898 Blend test 2023-10-15 14:44:32 -04:00
MagicBot 13f5e3eff2 Comment cleanup 2023-10-15 14:35:16 -04:00
MagicBot db9e950558 Comment cleanup 2023-10-15 14:30:58 -04:00
MagicBot 3f93bf08fb Test raw blend 2023-10-15 14:27:52 -04:00
MagicBot 65eebcbb5d Blend updated 2023-10-15 14:07:54 -04:00
MagicBot 6ed3495780 Blend updated 2023-10-15 13:57:18 -04:00
MagicBot 06049a7135 Dev cmd updated 2023-10-15 13:47:52 -04:00
MagicBot 12e073ca46 Dev cmd updated 2023-10-15 13:47:35 -04:00
MagicBot 4ee4054ab3 Dev cmd updated 2023-10-15 13:46:39 -04:00
MagicBot 11664a9218 Dev cmd updated 2023-10-15 13:42:28 -04:00
MagicBot d414c19904 Set parent zone properly 2023-10-15 13:31:31 -04:00
MagicBot 279a0aed91 Use half extents as offset from center 2023-10-12 07:04:27 -04:00
MagicBot c6e0e36531 Dev command updated 2023-10-12 07:01:11 -04:00
MagicBot 10b9f19036 Dev command updated 2023-10-12 06:51:01 -04:00
MagicBot ad661ea464 Dev command updated 2023-10-12 06:43:02 -04:00
MagicBot affe6b08ab Method is now called 2023-10-12 06:33:22 -04:00
MagicBot 1b2c218e83 property conforms to JSON 2023-10-12 06:19:22 -04:00
MagicBot 9e96add299 Class cleanup 2023-10-12 06:12:40 -04:00
MagicBot 9f9c3ba7f1 Ratios initialized. 2023-10-12 06:08:29 -04:00
MagicBot d15b8a5246 Opposite of 1006300 created as 1006301. 2023-10-12 06:01:55 -04:00
MagicBot c1e1c730bb Opposite of 1006300 created as 1006301. 2023-10-12 05:49:22 -04:00
MagicBot a53c68054d Only one kind of zone. 2023-10-11 17:20:23 -04:00
MagicBot 99a79df02d abs is up the chain a step 2023-10-11 17:17:18 -04:00
MagicBot 1a0f318968 abs is up the chain a step 2023-10-11 17:14:40 -04:00
MagicBot 6ac65c73d5 Method cleanup 2023-10-11 17:04:09 -04:00
MagicBot dc5a778610 Method cleanup 2023-10-11 17:00:53 -04:00
MagicBot 20d9a232cc Method cleanup 2023-10-11 17:00:01 -04:00
MagicBot 280bd61e2a Offset support for blend. 2023-10-11 16:50:52 -04:00
MagicBot dadfc15d39 Class cleanup and comments 2023-10-11 11:36:28 -04:00
MagicBot 1764041272 Class cleanup and comments 2023-10-11 11:34:37 -04:00
MagicBot b9ef4eee63 Class cleanup and comments 2023-10-11 11:32:43 -04:00
MagicBot 823061c699 Improved clamping 2023-10-11 11:23:20 -04:00
MagicBot 6809988e9c bugfix in variable assignment 2023-10-11 11:15:41 -04:00
MagicBot a1a3ea6234 Debug code added 2023-10-11 11:01:04 -04:00
MagicBot 3684296959 Assignment removed for now 2023-10-11 10:53:58 -04:00
MagicBot 68c8d91871 Assignment removed for now 2023-10-11 10:43:44 -04:00
MagicBot 7655b67338 Debug code added 2023-10-11 10:42:04 -04:00
MagicBot 68aef50283 Debug code added 2023-10-11 10:40:27 -04:00
MagicBot 6494e07e9e Test baseline 2023-10-10 12:34:21 -04:00
MagicBot 859de1004e Platform revert 2023-10-10 12:31:43 -04:00
MagicBot 0afc8a2dc5 Platform update 2023-10-10 07:59:42 -04:00
MagicBot f73184ac1e Blend cleanup 2023-10-09 10:56:39 -04:00
MagicBot 52b66be43b Blend cleanup 2023-10-09 10:47:48 -04:00
MagicBot bd208bd1ab Blend cleanup 2023-10-09 09:45:04 -04:00
MagicBot f7952008cd Blend cleanup 2023-10-09 09:35:24 -04:00
MagicBot a0c82d3f3f Blend cleanup 2023-10-09 09:32:20 -04:00
MagicBot dd01fd1688 Proper setting of maxpy 2023-10-09 09:22:41 -04:00
MagicBot d2dc95c169 Dev command updated 2023-10-09 08:44:06 -04:00
MagicBot 53f7165e24 Blend function installed 2023-10-09 07:47:50 -04:00
MagicBot c90a250ba7 Blend function installed 2023-10-09 07:05:54 -04:00
MagicBot e80dd66809 Interpolation cleanup 2023-10-09 06:20:17 -04:00
MagicBot 95558371df Method inlined 2023-10-09 06:16:25 -04:00
MagicBot 085f79cefd Sanity check added 2023-10-09 06:14:06 -04:00
MagicBot a17b9fdd13 Zone extents derived from zone 2023-10-09 06:04:37 -04:00
MagicBot 73b6854266 Map loaded updated 2023-10-09 05:44:38 -04:00
MagicBot fe8d512596 WorldAltitude for seafloor set 2023-10-09 04:51:50 -04:00
MagicBot ef8754c018 WorldAltitude for seafloor set 2023-10-09 04:48:22 -04:00
MagicBot 483ccbff00 WorldAltitude for seafloor set 2023-10-09 04:37:54 -04:00
MagicBot 07f736b8e6 WorldAltitude for seafloor set 2023-10-09 04:32:57 -04:00
MagicBot cd1de763e3 Terrain size set by zone radius 2023-10-09 04:14:51 -04:00
MagicBot d6d4008348 Error trap 2023-10-09 04:11:55 -04:00
MagicBot 4bbbbf9fa2 Error trap 2023-10-08 23:11:59 -04:00
MagicBot a3d29bb8f0 Error trap 2023-10-08 23:05:41 -04:00
MagicBot 0d58aee2fe Terrain type is capitalized 2023-10-08 22:54:40 -04:00
MagicBot bc5d0cc4a9 Terrain zone set in constructor 2023-10-08 22:49:13 -04:00
MagicBot 59c3bea2d6 Error logging added 2023-10-08 22:45:33 -04:00
MagicBot 13163ddb7e Error logging added 2023-10-08 22:44:34 -04:00
MagicBot 02a9256950 Configure player cities and PLANAR 2023-10-08 22:40:31 -04:00
MagicBot d31d6c1f95 Configure player cities and PLANAR 2023-10-08 22:36:26 -04:00
MagicBot bc099e9dc0 Constructor filled in 2023-10-08 21:51:16 -04:00
MagicBot 79bf0523a5 Constructor filled in 2023-10-08 21:50:27 -04:00
MagicBot a0d2ccb5ab Completed partial refactor. 2023-10-08 20:26:37 -04:00
MagicBot df54840a88 Completed partial refactor. 2023-10-08 09:59:13 -04:00
MagicBot 4b62517d99 Partial refactor. 2023-10-08 09:49:49 -04:00
MagicBot 0ce9ec3ae2 Output conforms with client 2023-10-08 09:32:08 -04:00
MagicBot 5279fa8fbe Dev command updated 2023-10-08 09:22:53 -04:00
MagicBot 0d75e6db9b Start terrain refactor 2023-10-08 09:18:43 -04:00
MagicBot ffb541a12e Prepare for terrain 2023-10-08 09:09:50 -04:00
MagicBot 5fdaa11367 Prepare for terrain 2023-10-08 09:04:15 -04:00
MagicBot 6b339da061 Count propagated 2023-10-07 21:03:47 -04:00
MagicBot f454fb5e1c Need float value 2023-10-07 20:55:11 -04:00
MagicBot 5db8c47aa8 Clamp value at pole 2023-10-07 20:47:35 -04:00
MagicBot e7571f3e83 Audit of zone loc 2023-10-07 20:43:17 -04:00
MagicBot d9b513e88c cell count cached 2023-10-07 20:32:08 -04:00
MagicBot 7dcde390cd Flip Flop 2023-10-07 20:19:30 -04:00
MagicBot 6a750f4eb2 Unused methods removed 2023-10-07 20:04:26 -04:00
MagicBot c6d24d25cc Method cleanup 2023-10-07 13:57:20 -04:00
MagicBot c19ec913cb Disable blend until after refactor. 2023-09-21 14:39:37 -04:00
MagicBot 438ea04a1a Comment cleanup 2023-09-20 17:26:00 -04:00
MagicBot d7044c1663 Depth less one 2023-09-20 17:24:41 -04:00
MagicBot 3497d275a8 File reformat 2023-09-20 17:21:34 -04:00
MagicBot 6fd61889a8 byte array to save memory. 2023-09-20 17:20:54 -04:00
MagicBot 85983954de Conform to database 2023-09-20 16:28:26 -04:00
MagicBot 1e9eec2c48 Heightmap is now an integer. 2023-09-20 16:24:00 -04:00
MagicBot bd97745ed1 class and table schema now conform to JSON 2023-09-20 16:07:50 -04:00
MagicBot 34d450fecf class and table schema now conform to JSON 2023-09-20 16:06:57 -04:00
MagicBot be107c0858 class and table schema now conform to JSON 2023-09-20 16:05:57 -04:00
MagicBot 8289786099 class and table schema now conform to JSON 2023-09-20 16:03:55 -04:00
MagicBot 56f159d50a class and table schema now conform to JSON 2023-09-20 16:01:01 -04:00
MagicBot 61961bab05 class and table schema now conform to JSON 2023-09-20 16:00:16 -04:00
MagicBot e0387dce00 class and table schema now conform to JSON 2023-09-20 15:53:41 -04:00
MagicBot 46b3db033b Inlined empty getters 2023-09-20 15:43:01 -04:00
MagicBot bf9fdae58b Method moved to manager. 2023-09-20 14:31:48 -04:00
MagicBot 7b8cafc8ac Cleanup of interpolation method 2023-09-20 14:20:22 -04:00
MagicBot 7793fab5d2 Unnecessary initialization. 2023-09-20 14:14:55 -04:00
MagicBot 1ddcda5c5d Logging to console 2023-09-20 14:04:55 -04:00
MagicBot 9714393538 Pixel data loaded from TARGA files 2023-09-20 13:59:32 -04:00
MagicBot d46f369599 Unused variables 2023-09-20 13:49:27 -04:00
MagicBot 2dfd2a53c2 Testing image reader 2023-09-20 13:37:43 -04:00
MagicBot e3675ec9a4 Testing image reader 2023-09-20 13:26:54 -04:00
MagicBot cb2ed0c766 Testing image reader 2023-09-20 13:23:02 -04:00
MagicBot 6638fdcaff Framework to load pixel data 2023-09-20 13:06:18 -04:00
MagicBot d0b4634429 Framework to load pixel data 2023-09-20 12:46:41 -04:00
MagicBot 1fdf1f1339 New collection defined for pixel data 2023-09-20 11:59:43 -04:00
MagicBot 6290c6d0af Start separate PLANAR from TARGA 2023-09-20 11:40:29 -04:00
MagicBot 26a3ea4b18 Release bounds after usage. 2023-09-20 11:38:39 -04:00
MagicBot c7b2245005 Unused methods removed 2023-09-20 11:35:39 -04:00
MagicBot 5ba06796b1 Interpolating from adjusted altitudes. 2023-09-18 03:19:00 -04:00
MagicBot e359b1dfdf Interpolating world altitude 2023-09-18 02:11:38 -04:00
MagicBot cbc8216fe0 Blender 2023-09-18 00:05:53 -04:00
MagicBot da238b9986 Cleanup in bounds configuration 2023-09-17 23:56:45 -04:00
MagicBot 897ddfe77a Bounds must be set before setting parent. 2023-09-17 23:53:06 -04:00
MagicBot 80f2db794f Bounds must be set before setting parent. 2023-09-17 23:46:00 -04:00
MagicBot 913a2601d5 Update to blend logic. 2023-09-17 14:02:17 -04:00
MagicBot 40c27eef79 Update to blend logic. 2023-09-17 14:00:00 -04:00
MagicBot df45e00fbd 255 to normalize 2023-09-17 13:39:42 -04:00
MagicBot a323f1ffb7 max based on min blend 2023-09-17 13:30:16 -04:00
MagicBot ea6092db8a max based on min blend 2023-09-17 13:28:23 -04:00
MagicBot 8c6eb48876 max based on min blend 2023-09-17 13:25:15 -04:00
MagicBot 37d2f8a8ad DevCmd output updated 2023-09-17 13:11:29 -04:00
MagicBot f18acf3e68 DevCmd output updated 2023-09-17 13:08:51 -04:00
MagicBot 3fb08ca2c3 Visibility promotion for a data class 2023-09-17 12:53:56 -04:00
MagicBot 83be09d643 Comment and name cleanup 2023-09-17 12:49:30 -04:00
MagicBot 6de8249fb0 Devcmd output updated. 2023-09-17 12:44:37 -04:00
MagicBot 013ddcff66 heightmap blend configuration completed. 2023-09-17 12:25:07 -04:00
MagicBot 8ece4caf1c value is halfExtent 2023-09-17 12:23:06 -04:00
MagicBot a94b12e8cd Correction to blend configuration. 2023-09-17 12:15:21 -04:00
MagicBot c38103068e Correction to blend configuration. 2023-09-17 12:13:46 -04:00
MagicBot f8caaf0e99 Correction to blend configuration. 2023-09-17 12:07:43 -04:00
MagicBot ee809ddb37 clamping cleaned up. 2023-09-17 12:01:13 -04:00
MagicBot 227bd0523e clamping cleaned up. 2023-09-17 11:59:46 -04:00
MagicBot c096b29521 parameter ordering fixed. 2023-09-17 11:57:24 -04:00
MagicBot 6a0520b126 Blend lerp implemented. 2023-09-17 11:54:57 -04:00
MagicBot 240373898a Preparation for blend lerp insertion. 2023-09-17 08:08:28 -04:00
MagicBot d33ad0cdef Preparation for blend lerp insertion. 2023-09-17 08:03:50 -04:00
MagicBot a3a3070158 Blending configuration setup in SetParent() 2023-09-17 07:42:46 -04:00
MagicBot b717c3d550 Starting work to sync heightmap model with Shadowbane. 2023-09-16 16:03:22 -04:00
MagicBot 9aa5820ac2 Cleanup of getWorldHeight() 2023-09-16 13:18:36 -04:00
MagicBot 1ac65dd9bd Tightened clamping. 2023-09-16 08:31:04 -04:00
MagicBot 797a6951a8 Tightened clamping. 2023-09-16 08:28:20 -04:00
MagicBot 7268de6e1e Test of raw heightmaps 2023-09-16 08:06:31 -04:00
MagicBot fc602ce9f4 Test of raw heightmaps 2023-09-16 08:04:49 -04:00
MagicBot 403bff27b4 Test of raw heightmaps 2023-09-16 08:01:46 -04:00
MagicBot 44b9ba911d Indices added to command output. 2023-09-15 17:29:51 -04:00
MagicBot c24f8fc85b Login check modified for testing. 2023-09-15 14:23:34 -04:00
MagicBot 75c56cbeee Devcmd output updated. 2023-09-14 14:11:26 -04:00
MagicBot 15f42c9658 Devcmd output updated. 2023-09-14 13:54:22 -04:00
MagicBot 525d0c21bb Devcmd output updated. 2023-09-14 13:41:07 -04:00
MagicBot cbf05cfe5b Devcmd output updated. 2023-09-14 13:30:46 -04:00
MagicBot aaa506a581 Divisor testing. 2023-09-14 13:21:02 -04:00
MagicBot a2fbfad00e Revert initialize. 2023-09-14 13:07:32 -04:00
MagicBot 031c52e25a Divisor test. 2023-09-14 13:03:06 -04:00
MagicBot 693dfd827c Updated dev cmd output 2023-09-14 13:01:22 -04:00
MagicBot d26a2d35bf Multiple not divide 2023-09-14 12:39:31 -04:00
MagicBot 9839de128c Variable initialized. 2023-09-14 12:38:47 -04:00
MagicBot 12872ee51e Variable initialized. 2023-09-14 12:30:54 -04:00
MagicBot 2af08d6823 Reformat file. 2023-09-14 12:29:26 -04:00
MagicBot f646075311 Static method to save memory. 2023-09-14 12:28:36 -04:00
MagicBot dfca767476 Multiple not divide. 2023-09-14 12:25:18 -04:00
MagicBot fd7b5952c2 Dev command updated 2023-09-14 12:21:12 -04:00
MagicBot 4b46eddc47 Dev command updated 2023-09-14 12:09:50 -04:00
MagicBot e26121177f World altitude set in setparent. 2023-09-14 12:07:08 -04:00
MagicBot 91eb0c314f SeAudit command created 2023-09-14 10:14:31 -04:00
MagicBot 1d7a2d4eae Added sea level info to command. 2023-09-14 10:09:10 -04:00
MagicBot e4235d4d75 Bugfix in setparent. 2023-09-14 09:13:02 -04:00
FatBoy 41a83115be safehold guard exclusion from equipment dropping 2023-09-13 22:34:57 -05:00
FatBoy 3ce887cb34 NPC are immune to all 2023-09-13 22:30:24 -05:00
FatBoy 874eb6189e NPC apply runes 2023-09-13 22:24:10 -05:00
FatBoy 5c5c491597 debug code 2023-09-13 22:10:22 -05:00
FatBoy ff78c1443c null check 2023-09-13 22:04:23 -05:00
FatBoy cdc1c2d776 region assignment 2023-09-13 21:58:20 -05:00
FatBoy a004c247ab abstract character cleanup 2023-09-13 21:57:17 -05:00
FatBoy 048e90fb8f NPC all apply "shopkeeper" rune 2023-09-13 21:56:18 -05:00
FatBoy c1498145e6 NPC rune work 2023-09-13 21:45:15 -05:00
FatBoy 7654d5183a region lookup and height offset for AbstractCharacters when setLoc is called 2023-09-13 21:28:20 -05:00
FatBoy 9b7fc0a93b region height work 2023-09-13 21:07:57 -05:00
FatBoy 200318ddcf add region height to world height in setLoc 2023-09-13 20:48:02 -05:00
FatBoy 1fdd0a1b32 initialize runes array list for NPC 2023-09-13 20:45:21 -05:00
FatBoy 8869772fa4 print effects command 2023-09-13 20:34:48 -05:00
FatBoy 96bc894962 print runes command 2023-09-13 20:27:38 -05:00
FatBoy 5a9f5f2eca NPCs apply runes from set 2023-09-13 20:22:56 -05:00
FatBoy bd9dbcbb42 NPCs load rune sets 2023-09-13 20:12:07 -05:00
FatBoy f8269bb764 character runes moved form PlayerCharacter to AbstractCharacter 2023-09-13 20:06:12 -05:00
FatBoy c215047c00 teleport method removed form PLayerCharacter to use AbstractCharacter.teleport instead 2023-09-13 20:00:23 -05:00
FatBoy a313e3f364 setRegion removal 2023-09-13 19:56:54 -05:00
FatBoy b34be1184e null region assignment 2023-09-13 19:53:13 -05:00
FatBoy e23c5527da null region assignment 2023-09-13 19:52:17 -05:00
FatBoy 847e62dd27 setLoc now handles region assignment 2023-09-13 19:51:39 -05:00
MagicBot f5d83aa259 Class cleanup of bonus code and unused methods. 2023-09-13 09:38:10 -04:00
MagicBot 4a5c0ae5a0 Cities don't actually have a location. They are a property of a zone. Let's start here. 2023-09-13 09:29:42 -04:00
MagicBot b4a4323906 Minor formatting cleanup. 2023-09-13 09:24:40 -04:00
MagicBot 48fc5af5f7 Removed unused variables from class. 2023-09-13 07:33:02 -04:00
MagicBot a1753a28ec Player cities write correct offset. 2023-09-13 07:29:29 -04:00
MagicBot fa4039cf63 Add y offset to zone altitude. 2023-09-12 16:25:46 -04:00
MagicBot 4b0814c0a1 Add y offset to zone altitude. 2023-09-12 16:24:47 -04:00
MagicBot 78d0b06b36 Revert for testing. 2023-09-12 16:22:41 -04:00
MagicBot 426bdf5df3 Removed yoffset from world altitude. 2023-09-12 16:13:27 -04:00
MagicBot 5dbad7ebd0 Player cities set to white. 2023-09-12 15:33:52 -04:00
MagicBot 6ef33c5b7f Update to world altitude calculation 2023-09-12 15:27:00 -04:00
MagicBot 3737a6eace Sea level logic updated. 2023-09-12 15:18:09 -04:00
MagicBot 967e129724 Sea level logic updated. 2023-09-12 15:09:52 -04:00
MagicBot e9d549377e Sea level logic updated. 2023-09-12 15:06:26 -04:00
MagicBot 924b8af827 Sea level logic updated. 2023-09-12 14:57:47 -04:00
MagicBot 045ee73b61 rework of world altitude calculation. 2023-09-12 14:51:04 -04:00
MagicBot 5d9d13ce07 Any argument rebuilds world altitude. 2023-09-12 13:06:46 -04:00
MagicBot 5a1347ec50 Devcmd updated 2023-09-12 13:01:32 -04:00
MagicBot c705f45856 Devcmd updated 2023-09-12 12:38:20 -04:00
MagicBot 83fc129d05 Dev command output update. 2023-09-11 15:59:08 -04:00
MagicBot d7cde3a77f Grid flip testing 2023-09-11 15:41:44 -04:00
MagicBot afb1ad8e94 Grid flip testing 2023-09-11 15:36:59 -04:00
MagicBot 15a79ee9bd devcmd output updated with grid. 2023-09-11 14:37:16 -04:00
MagicBot 68794c170b Removed usless method: added grid to cmd output. 2023-09-11 14:30:14 -04:00
MagicBot a9d84749ba Removed worthless command. 2023-09-11 14:26:06 -04:00
MagicBot dd5fc323ef bugfix in array loading 2023-09-11 14:06:22 -04:00
MagicBot cf1547d077 DevCmd Updated 2023-09-11 13:57:05 -04:00
MagicBot 9664c99e06 DevCmd Updated 2023-09-11 13:50:56 -04:00
MagicBot 17b7fb6999 Unused method 2023-09-11 13:48:16 -04:00
MagicBot 21a4db8a81 Pixels set to 0 2023-09-11 13:40:47 -04:00
MagicBot eabdabcfcd No insane bucket widths. 2023-09-11 12:38:46 -04:00
MagicBot c548383a4c Should not be putting empty maps into the collection with id 0. 2023-09-11 12:35:58 -04:00
MagicBot 7337f4be1e DevCmd update. 2023-09-11 12:14:42 -04:00
MagicBot d84f223b9d DevCmd update. 2023-09-11 12:08:39 -04:00
MagicBot 5431112186 DevCmd update. 2023-09-11 11:35:53 -04:00
MagicBot ff743151c6 DevCmd update. 2023-09-11 11:25:28 -04:00
MagicBot b923392b53 DevCmd update. 2023-09-11 11:18:22 -04:00
MagicBot 15d272c621 DevCmd update. 2023-09-11 11:17:34 -04:00
MagicBot eefa50b2c3 DevCmd update. 2023-09-11 11:14:55 -04:00
MagicBot ecc7a152f7 DevCmd update. 2023-09-11 11:08:03 -04:00
MagicBot 7bf31f9a47 Rework of class interface. 2023-09-11 11:01:09 -04:00
MagicBot 7dc970ff53 Rework of dev command; junk deleted. 2023-09-11 10:50:01 -04:00
FatBoy 97d71ec361 move to point handler revert 2023-09-11 01:36:45 -05:00
FatBoy 003b939d33 Move to point message variable naming and handler cleanup 2023-09-10 19:37:46 -05:00
FatBoy 9989cbff24 pc.teleport uneeded 2023-09-10 17:20:30 -05:00
FatBoy 426ef989f8 can no longer run to invalid targets 2023-09-10 16:45:17 -05:00
FatBoy ca6e079053 fresh start 2023-09-10 15:51:25 -05:00
FatBoy 13644fd308 use target from message in move to point 2023-09-10 15:02:26 -05:00
FatBoy 1ec76ae3fc use target from message in move to point 2023-09-10 14:58:56 -05:00
FatBoy 51d75146cc NPC added to attack message handler switch 2023-09-10 14:28:32 -05:00
FatBoy bc4222646d combat target usage 2023-09-10 14:12:01 -05:00
FatBoy c3e206e3b1 null check 2023-09-10 14:09:48 -05:00
FatBoy 04147e11cc logic for moveToPoint message handler 2023-09-10 14:08:54 -05:00
FatBoy 545cb4cddf null check for building pulled 2023-09-10 13:40:19 -05:00
FatBoy 0f948d4e2a removed redundant setCombatTarget 2023-09-10 13:39:27 -05:00
FatBoy 5fb3e0fe14 switch for target type in attack message handler 2023-09-10 13:38:07 -05:00
MagicBot fb87dfd91e TargetType declared. 2023-09-10 14:33:04 -04:00
FatBoy be8967b05f null set for target 2023-09-10 13:28:46 -05:00
FatBoy 8acfff7faa null check for target 2023-09-10 13:26:28 -05:00
FatBoy 18e1f4bd28 early exits for attack message handler 2023-09-10 13:25:08 -05:00
MagicBot 74f88a6643 Unused variable removed 2023-09-10 14:04:48 -04:00
FatBoy 47fe764cb0 early exits for attack message handler 2023-09-10 12:58:24 -05:00
MagicBot 9e53770e6c Handler added to protocol class. 2023-09-10 13:55:16 -04:00
MagicBot a9cc001791 Handler added to protocol class. 2023-09-10 13:53:12 -04:00
MagicBot c24913d124 Handler filled in with logic. 2023-09-10 13:52:04 -04:00
MagicBot 63bf0b6070 Handler created for AttackMsg 2023-09-10 13:43:28 -04:00
FatBoy 50792327a4 moveToPoint attack handling 2023-09-10 12:31:39 -05:00
FatBoy 46e67be8ca player character attacks added to city outlaws 2023-09-10 11:57:52 -05:00
FatBoy e7c3ba5eba guards and siege engines ignore idle state with no players loaded 2023-09-09 22:30:45 -05:00
FatBoy ea86ab2300 guards will revert cmbat target to null if its a player and is no longer loaded 2023-09-09 22:23:25 -05:00
FatBoy 501e8c937f guards use city player memory to determine whether they go idle or not 2023-09-09 22:10:10 -05:00
FatBoy cae5c36d84 guards will aggro siege equipment not belonging to the guild 2023-09-09 22:01:59 -05:00
FatBoy 1b92fa76e1 characters that attack city friendly buildings are added to cityOutlaws 2023-09-09 21:48:22 -05:00
FatBoy bbdb683061 players who attack buildinsg added to cityOutlaw list 2023-09-09 21:43:29 -05:00
FatBoy 2d04547c74 display seeInvis level in aiInfo command 2023-09-09 21:19:29 -05:00
FatBoy 5192c801f7 CombatUtilities cleanup 2023-09-09 20:56:19 -05:00
FatBoy d966d50bd5 removed duplicate variables in MobBase 2023-09-09 20:40:52 -05:00
FatBoy 7e20db33f2 final guard stat revisions 2023-09-09 20:37:47 -05:00
FatBoy 669ee7215b added range modification for guards 2023-09-09 20:11:00 -05:00
FatBoy 6fa00a43a4 removed unused method 2023-09-09 20:06:33 -05:00
FatBoy 4edf740179 finished modifications for guards 2023-09-09 19:57:17 -05:00
FatBoy c7abb4c920 stance modifiers for guards 2023-09-09 19:41:32 -05:00
FatBoy df3964110a stances for guards 2023-09-09 19:23:46 -05:00
FatBoy 96231260bc consolidated all guards to GuardLogic 2023-09-09 10:37:40 -05:00
FatBoy 967303d2de outlaw and hate value moved to modifyHealth 2023-09-09 10:20:25 -05:00
FatBoy 955481773d wall archer early exit for canCast 2023-09-09 09:52:47 -05:00
FatBoy d66a7049e8 guard walking bug fix 2023-09-09 09:35:03 -05:00
MagicBot e73b8d2826 Harden against null 2023-09-09 10:20:20 -04:00
MagicBot ea23003807 Hirelings removed from zone mob set 2023-09-09 10:16:36 -04:00
MagicBot 23f41f8ae7 Minions always have offset not determined by captain being alive. 2023-09-09 09:26:55 -04:00
MagicBot 3f416f83d3 Patrol points only set once. 2023-09-09 09:11:43 -04:00
MagicBot 931d1992b6 Patrol points are reset each patrol. 2023-09-09 09:10:08 -04:00
MagicBot fd927a7052 New method implemented. 2023-09-09 08:58:41 -04:00
MagicBot dd46224afe New method implemented. 2023-09-09 08:44:00 -04:00
MagicBot be2b29ccc7 New method implemented. 2023-09-09 08:38:00 -04:00
MagicBot c93e3bc947 Update to ordering of logic 2023-09-09 08:34:09 -04:00
MagicBot 7d49395c41 New method implemented. 2023-09-09 08:31:20 -04:00
MagicBot f4c9e6d7b8 Remove hireling method defined in manager. 2023-09-09 08:28:03 -04:00
MagicBot b7a907c8c8 db method to support removing all minions 2023-09-09 08:04:56 -04:00
MagicBot 36485a0f01 Formation enforced when captain is dead. 2023-09-08 12:44:36 -04:00
MagicBot efec1b4444 Load data only. 2023-09-08 12:39:04 -04:00
MagicBot bdf6500260 Outlaw moved before guild check. 2023-09-07 14:14:21 -04:00
MagicBot db4eb0579e Aggro code removed from check to send mob home. 2023-09-07 13:37:32 -04:00
MagicBot 76f33534d4 Captains force march minions 2023-09-07 13:09:25 -04:00
MagicBot 39fea5bc2f Captains order minions to patrol 2023-09-07 12:42:43 -04:00
MagicBot 660d5c1270 Captains order minions to patrol 2023-09-07 12:41:20 -04:00
MagicBot 781e2fc9b2 Comment adjusted 2023-09-07 12:27:23 -04:00
MagicBot c2a2464fe8 Errant delimiter removed. 2023-09-07 12:25:52 -04:00
MagicBot beb3c15eb3 Miniond patrol on own if captain is dead. 2023-09-07 12:24:45 -04:00
MagicBot 553010bb7b Minions get marching orders from captain 2023-09-07 12:07:39 -04:00
MagicBot 8d12bbf453 Formation offset for minions. 2023-09-07 11:48:42 -04:00
MagicBot fa7588826a Pets set to not alive when dismissing. 2023-09-07 11:15:30 -04:00
MagicBot 332f191e19 Merged switch cases. 2023-09-07 10:56:46 -04:00
MagicBot 8151382a6b Patrol points inherited from barracks not captain. 2023-09-07 10:49:07 -04:00
MagicBot ae44a21be1 Duplicate range check removed. 2023-09-07 10:40:27 -04:00
MagicBot b0ff0995de Start consolidation of guard logic 2023-09-07 10:37:09 -04:00
MagicBot e711095ecd Start consolidation of guard logic 2023-09-07 10:36:18 -04:00
MagicBot 08de97a2a8 Guild check removed from outlaw condition. 2023-09-07 09:55:55 -04:00
MagicBot 5eb6302d2a Null check is made before this method call. 2023-09-05 15:56:49 -04:00
MagicBot 2e346ae7fd Rework of combat deference to captain. 2023-09-05 15:51:14 -04:00
MagicBot 1285d12915 Consolidated cast methods. 2023-09-05 14:25:24 -04:00
MagicBot 8b5cb9258e dd roll removed 2023-09-05 14:09:48 -04:00
MagicBot ef3e3a0392 .contains check needed. 2023-09-05 13:43:09 -04:00
MagicBot 8fca6572f9 Typo in comment fixed. 2023-09-05 13:10:17 -04:00
MagicBot 33eaf0e583 Outlaws added to aiinfo. 2023-09-05 13:04:56 -04:00
MagicBot 16acd1c08c Simplify logic; variable is provided. 2023-09-05 12:55:12 -04:00
MagicBot a8e8804ce3 Attacking guard flags you as an outlaw. 2023-09-05 12:34:46 -04:00
MagicBot b8c0f997f6 Fix typo in thread name. 2023-09-05 12:30:47 -04:00
MagicBot 11e63f38b1 Update to mob retaliate logic. 2023-09-05 12:19:50 -04:00
MagicBot ff36d8f3db Modification to minion retaliate. 2023-09-05 08:27:34 -04:00
MagicBot 975542d8af sql column update. 2023-09-04 15:21:04 -04:00
MagicBot d71a9415b4 Integer object not int signature. 2023-09-04 15:09:51 -04:00
MagicBot e948da95b5 Column name updated. 2023-09-04 14:58:13 -04:00
MagicBot 9a6510c320 Minions now use copyonwrite collection. Slot agnostic. 2023-09-04 14:50:59 -04:00
MagicBot 57ff1ede97 Name is all that's needed. 2023-09-04 14:16:36 -04:00
MagicBot 7c0f2563f7 Already added to collection at this point. 2023-09-04 13:09:32 -04:00
FatBoy d11a954b40 remove test block 2023-09-03 20:41:21 -05:00
FatBoy f354339af1 null checks 2023-09-03 20:38:48 -05:00
FatBoy 89658bb77a null checks 2023-09-03 20:28:17 -05:00
FatBoy 1ff0238b6e skill loading bypass for guards 2023-09-03 20:22:01 -05:00
FatBoy e777434d57 Mob specific rune skill loading 2023-09-03 20:10:57 -05:00
FatBoy ee6efc30a3 rune skill loading broken into static method in NPCManager 2023-09-03 19:52:16 -05:00
FatBoy 0758bb5f38 SkillsBase are now cached when missing for mobs 2023-09-03 19:44:33 -05:00
FatBoy 299d5725a6 lookup using name 2023-09-03 19:31:04 -05:00
FatBoy d7c9b31ec7 indentation and comment 2023-09-03 19:24:34 -05:00
FatBoy 6c78bee5c1 null check 2023-09-03 19:24:06 -05:00
FatBoy dba0cbd5f9 skill type not name used 2023-09-03 19:22:28 -05:00
FatBoy 0752e780f2 mobs load skills 2023-09-03 19:19:18 -05:00
MagicBot c43919ce01 Level loaded into object. 2023-09-03 09:48:37 -04:00
MagicBot 0d95510b72 captain uuid added to aiInfoCmd 2023-09-03 09:15:20 -04:00
MagicBot 60fb2571a2 Support for loading of skill adjustment map. 2023-09-03 08:18:48 -04:00
MagicBot 90cbe90492 Merge remote-tracking branch 'origin/mobile-effects' into magicbox-1.5.2 2023-09-03 07:33:50 -04:00
FatBoy 95c203b0ed load and apply mobbaseSkill 2023-09-02 20:39:36 -05:00
FatBoy 449c5c5c77 infrastructure for mob skills loading 2023-09-02 20:29:03 -05:00
FatBoy 9aff208403 guard captains to move tot heir first patrol point right away 2023-09-02 19:43:40 -05:00
FatBoy 4318849127 minion relatiate handled inside retaliate function 2023-09-02 19:34:08 -05:00
FatBoy 29e8cdf699 attacking guard minion will no longer be ignored 2023-09-02 19:23:33 -05:00
MagicBot 4427dbdcad Fix in exception for werwolf/werebear (magic numbers) 2023-09-02 16:28:16 -04:00
MagicBot af4c3819b9 contract added to aiInfoCmd 2023-09-02 16:18:05 -04:00
MagicBot 39379e1ac0 Sight check moved out of cancast. 2023-09-02 16:04:40 -04:00
MagicBot 71eeb3f6b8 Variable hidden elevated to abschar. 2023-09-02 15:57:23 -04:00
MagicBot d409ef49af Can cast added to aiinfo. 2023-09-02 15:44:42 -04:00
MagicBot e7a80e9280 Comment cleanup 2023-09-02 15:33:12 -04:00
MagicBot 65c2d2ea0b Logic cleanup when dealing with contracts. 2023-09-02 15:30:10 -04:00
MagicBot 92666dca21 Invis check precedes power check. 2023-09-02 15:25:19 -04:00
MagicBot 3e1a79c248 AI info dev command updated. 2023-09-02 15:11:17 -04:00
MagicBot 73a1ce083a Unused method removed. 2023-09-02 15:00:38 -04:00
MagicBot 22dacebc5e Override unnecessary. 2023-09-02 15:00:06 -04:00
MagicBot 80d0948e24 Contract power handling now additive. 2023-09-02 14:04:47 -04:00
MagicBot 58b427b977 Contract support added to mobile ai when gathering powers. 2023-09-02 13:34:26 -04:00
MagicBot a4cab3565a Value cannot be null. Set early in runafterload. 2023-09-02 13:16:34 -04:00
MagicBot 205c9580e3 sql column name fix. 2023-09-02 12:52:55 -04:00
MagicBot 70a0ed135b Refactored mob powers to rune powers. Now uses rune_id to call into system which is derived in the getter to support minions. 2023-09-02 12:47:04 -04:00
FatBoy f556181d77 guardlist serialization displays correct minion rank 2023-09-01 22:15:29 -05:00
FatBoy d48e26904e revert last commit 2023-09-01 22:06:21 -05:00
FatBoy 19232ac405 archers added to human guards as minions 2023-09-01 22:01:09 -05:00
FatBoy 9ee2ccc8af werebear and werewolf guard can use powers 2023-09-01 21:48:57 -05:00
FatBoy 7079bb6a63 resist loading refactored as static method to NPCManager 2023-09-01 21:39:34 -05:00
FatBoy 0ab5827ee5 mobs to load equipment resists 2023-09-01 21:34:48 -05:00
FatBoy c5443f622c utilization and assignment of aiAgentType 2023-09-01 20:57:09 -05:00
FatBoy e4aa276cca cleanup old code 2023-09-01 20:42:33 -05:00
FatBoy 90ff2d679e create and use applyMobbaseEffects method, remove old unused methods 2023-09-01 20:39:31 -05:00
FatBoy da26c35d5a mobbase loads effectsList 2023-09-01 20:36:07 -05:00
MagicBot 779e3da74e Cleanup of clear minion logic. 2023-09-01 14:33:33 -04:00
MagicBot e358c08773 Removed msg from handler. 2023-09-01 14:23:55 -04:00
MagicBot 2945fa3a47 Class reformat and removal of try block. 2023-09-01 14:17:07 -04:00
MagicBot ab1541e741 Class not needed on login server. 2023-09-01 14:09:48 -04:00
MagicBot 3aeaa709a5 Comment cleanup 2023-09-01 14:07:00 -04:00
MagicBot 91e627df6b AI moved to top of runafterload. 2023-09-01 14:05:50 -04:00
MagicBot d0795e9e1c Rework of agent type init in runafterload. Only used for 2 instances from disk. 2023-09-01 13:57:58 -04:00
MagicBot 0e12dd4874 Contract powers loaded first to preserve ordering. 2023-09-01 12:57:20 -04:00
MagicBot 25c0e48181 Loot bypass now uses agent type. 2023-09-01 12:55:33 -04:00
MagicBot 0d43c3620d Value is set earlier. 2023-09-01 12:50:57 -04:00
MagicBot 2f6137f8df Minion agent type set properly. 2023-09-01 12:38:23 -04:00
FatBoy 2843b86a93 Moved agent type to top of constructor. 2023-09-01 12:29:06 -04:00
MagicBot 8235de07ff Updated output of devcmd. 2023-08-31 14:00:34 -04:00
MagicBot e2f9a4c7f0 Guard minions inherit powers from captain. 2023-08-31 13:57:46 -04:00
MagicBot 55c6e3cf93 Refactored out duplicate power collection. 2023-08-31 13:42:15 -04:00
MagicBot 11c154e564 Assignment fix and comment cleanup. 2023-08-31 08:58:55 -04:00
MagicBot 7fc0d27c3c Siege engine agent type set properly. 2023-08-31 08:31:48 -04:00
MagicBot 1ac76cfcd8 isPlayerguard refactored to derive from agenttype. 2023-08-31 08:13:37 -04:00
MagicBot c8ed04aaaf Refactor to separate persistence and write fsm to table. 2023-08-31 08:03:30 -04:00
MagicBot 6641651f3c Unused method removed. 2023-08-31 07:27:03 -04:00
MagicBot dbf164bfb2 bonus code removal 2023-08-30 15:47:08 -04:00
MagicBot 8a617c3008 Siege minion spawn time set to 15m. 2023-08-30 15:33:55 -04:00
FatBoy a50a2430ba hate value for chants to affect mobs in range 2023-08-29 21:49:02 -05:00
FatBoy 5c3c552288 usage of AIAgentType for default patrol points 2023-08-29 21:17:44 -05:00
FatBoy 69fdddfc71 hate value fix 2023-08-29 21:01:00 -05:00
FatBoy db5b988275 usage of AIAgentType for pet checks in run after load 2023-08-29 20:18:05 -05:00
FatBoy 4284757035 pet level set in run after load removed 2023-08-29 20:16:00 -05:00
FatBoy b93a47acc0 pet death and dismissal fix 2023-08-29 20:12:48 -05:00
MagicBot d59f9857ce Cleanup in pet minion 2023-08-28 00:56:13 -04:00
FatBoy 8ce212b74b Merge remote-tracking branch 'origin/mob-refactor2' into mob-refactor2 2023-08-27 23:53:12 -05:00
FatBoy e78aea5735 Assign patrol points added as static method to NPC manager 2023-08-27 23:52:40 -05:00
MagicBot 9a3c5c3f40 Siege minion assigned UUID. 2023-08-28 00:46:39 -04:00
FatBoy 60ca3f9c34 remove siege minion 2023-08-27 23:42:04 -05:00
FatBoy e7e740dff1 blocked player character specific block in minion training message handler 2023-08-27 23:23:17 -05:00
MagicBot 8343a98d77 Minion added to map after runafterload. 2023-08-28 00:08:35 -04:00
MagicBot 5862039a00 Minion added to map after runafterload. 2023-08-28 00:07:40 -04:00
MagicBot 8af989b75f Fix is patrol logic bloc conditional. 2023-08-27 23:55:02 -04:00
MagicBot 08d0e5ff75 Logic isn't needed here. 2023-08-27 23:32:23 -04:00
MagicBot 5196d10e5c Logic isn't needed here. 2023-08-27 23:31:32 -04:00
MagicBot 3392ec463d Removed unused methods. 2023-08-27 23:29:45 -04:00
MagicBot 33529404cf Logic fix in siege minions. 2023-08-27 23:25:44 -04:00
MagicBot 00e7a36013 Logic fix in siege minions. 2023-08-27 23:22:28 -04:00
FatBoy 3060b394ab removed siegeminion map from NPC 2023-08-27 22:10:13 -05:00
MagicBot a43d9022fe Siege engine slot override. 2023-08-27 22:57:11 -04:00
FatBoy 6abdc68ca5 removed un-needed cast to player character for pets 2023-08-27 21:46:44 -05:00
FatBoy 61c66b0e96 trebs slot in proper locations 2023-08-27 21:38:31 -05:00
FatBoy 36cc23457a optimized slot for siege engines 2023-08-27 21:26:00 -05:00
FatBoy d573b238de refactored mob get/set owner 2023-08-27 21:04:34 -05:00
FatBoy 8afe25fe85 siege minions added to arty captain minion map 2023-08-27 20:50:13 -05:00
MagicBot f80647ff0d Spawn time set to 15s for debug. 2023-08-27 21:42:58 -04:00
MagicBot 7e64cbabf8 Update to slotting logic. 2023-08-27 21:30:57 -04:00
MagicBot 14a06410ae Update to slotting logic. 2023-08-27 21:25:43 -04:00
MagicBot 85c2a4f4f0 Add all as hirelings 2023-08-27 21:20:00 -04:00
FatBoy da9e211ec7 SiegeEngine enum and logic added 2023-08-27 20:05:18 -05:00
MagicBot a81070c471 Pet level += 20 to conform to 24.3 2023-08-26 15:47:10 -04:00
MagicBot e3ad7efa4f Method renamed for new convention. 2023-08-26 15:35:42 -04:00
MagicBot a4dafd7155 Unused variable in signature. 2023-08-26 15:34:27 -04:00
MagicBot 645aec853e Bindloc not adjusted for pets. 2023-08-26 15:21:50 -04:00
MagicBot d8d5e4a3c4 Name set to default. 2023-08-26 15:19:17 -04:00
MagicBot 7a48c04057 Mobbase set properly. 2023-08-26 15:10:14 -04:00
MagicBot 64aaaa707e Behaviour type set for pets. 2023-08-26 15:00:43 -04:00
MagicBot 445d40dc5f Bonus code removed. 2023-08-26 14:59:25 -04:00
MagicBot ebdcb531f2 AI methods moved to ai class. 2023-08-26 14:54:43 -04:00
MagicBot c9cdb891d6 Cleanup of ownerNPC mess. 2023-08-26 14:52:18 -04:00
MagicBot f5c6c002a8 Unused method removed. 2023-08-26 13:53:32 -04:00
MagicBot d171c6bb9a Unused method removed. 2023-08-26 13:47:41 -04:00
MagicBot 1c81a4faed Wall archers static reverted. 2023-08-26 13:38:09 -04:00
MagicBot e7d1d5cb71 Constructor removed. 2023-08-26 12:38:54 -04:00
MagicBot 060d831d50 Comment for clarity. 2023-08-26 12:37:28 -04:00
MagicBot 316bd6dd01 Siege engines use slot system. 2023-08-26 12:35:14 -04:00
MagicBot 34081e5903 Ordinal comparison fix. 2023-08-26 12:21:47 -04:00
MagicBot e2d843b65e Signature refactor. 2023-08-26 12:03:33 -04:00
MagicBot a796f5fe4b More siege engine work. 2023-08-26 11:55:18 -04:00
MagicBot 51ee41c773 use of SiegeEngine Behaviour Type 2023-08-26 11:19:36 -04:00
MagicBot 7e5ed3efe5 sqrMagnitude not sqrRoot 2023-08-26 11:09:58 -04:00
MagicBot 8dd25ac315 Minions inherit patrol points form barracks. 2023-08-26 11:06:48 -04:00
MagicBot 1cdaa58e7a Wall archers set to static grid type. 2023-08-26 10:11:13 -04:00
MagicBot fa3aa24a3d Update to minion building/location mechanic. 2023-08-26 09:41:58 -04:00
MagicBot 091431d95b Dynamic set in all constructors. 2023-08-26 09:31:10 -04:00
MagicBot 1ecf0122ab Unused variable removed. 2023-08-26 09:29:12 -04:00
MagicBot 79980a1725 NoID constructor removed. 2023-08-26 06:45:34 -04:00
MagicBot 8badcc3f6e Refactored out redundant stat-xyz variables. 2023-08-26 06:24:05 -04:00
MagicBot 4d6e57257c Unused methods removed. 2023-08-26 06:19:03 -04:00
MagicBot a7a93b8500 Tweak to bindloc for minions. 2023-08-25 17:05:46 -04:00
MagicBot 85cc34fb4c AIinfo updated. 2023-08-25 16:57:25 -04:00
MagicBot 772a996b6e Tweak to behavior type setup. 2023-08-25 16:49:26 -04:00
MagicBot e67eff822d Propagate guardedCity. 2023-08-25 16:44:45 -04:00
MagicBot c39ed6120f Cleanup of bind/loc logic. 2023-08-25 16:19:04 -04:00
MagicBot c38f4e6543 Mask only needs be set once. 2023-08-25 16:01:18 -04:00
MagicBot 098433b697 Needs contract null check 2023-08-25 15:46:09 -04:00
MagicBot c8e20c905b Add to cache before setloc 2023-08-25 15:37:02 -04:00
MagicBot bd2446ba0a Minion uuid set pre configure 2023-08-25 15:34:47 -04:00
MagicBot c179e4aaf3 Don't override level or name for minions. 2023-08-25 15:29:42 -04:00
MagicBot 2f8de2a919 Worthless collection only used in 2 places. 2023-08-25 15:23:02 -04:00
MagicBot 338110973d Mobbase cannot be null. 2023-08-25 15:19:25 -04:00
MagicBot 3c9c4495bc playerGuard = true. 2023-08-25 15:14:33 -04:00
MagicBot 93476f782c Bind loc not overwritten. 2023-08-25 15:03:37 -04:00
MagicBot 3aec6ee578 More minion setup work. 2023-08-25 14:45:47 -04:00
MagicBot 3bca76d4c8 Setloc to spawn minion. 2023-08-25 14:38:09 -04:00
MagicBot b9d6f35aac Unused variable. 2023-08-25 14:35:02 -04:00
MagicBot 9b6959414a More flushing out minion support. 2023-08-25 14:33:43 -04:00
MagicBot 400dd6aa5e More granular error reporting. 2023-08-25 14:08:43 -04:00
MagicBot 14af2f6efd Minion spawning re-enabled for refactoring. 2023-08-25 14:01:47 -04:00
MagicBot 0a2de9e0d5 Contract handling cleanup. 2023-08-25 13:41:22 -04:00
MagicBot 89bfad78a6 Contract handling cleanup. 2023-08-25 13:31:56 -04:00
MagicBot 52486fa278 Contract handling cleanup. 2023-08-25 13:24:07 -04:00
MagicBot dc0e14eb21 AI added earlier in sequence for availability. 2023-08-25 13:07:47 -04:00
MagicBot 70278374e7 manager init moved to the top of method. 2023-08-25 12:57:21 -04:00
MagicBot ac3588c76a manager init moved to the top of method. 2023-08-25 12:54:03 -04:00
MagicBot ab335aef2a Enums are fragile. 2023-08-25 12:32:36 -04:00
MagicBot 719c855bdb Cleanup of inventoryManager usage. 2023-08-25 12:27:58 -04:00
MagicBot f283e50018 Disabled minions for now. 2023-08-25 12:18:36 -04:00
MagicBot 99b952ee28 Refactor towards new constructor. 2023-08-25 12:12:54 -04:00
MagicBot 24639b62c0 Refactor towards new constructor. 2023-08-25 12:11:50 -04:00
MagicBot 573cc531bf Refactor towards new constructor. 2023-08-25 11:59:59 -04:00
MagicBot 29e24bae93 Unused constructor removed. 2023-08-25 11:37:56 -04:00
MagicBot 22e4cc07c0 Separate pet and siege behaviour types. 2023-08-25 11:26:09 -04:00
MagicBot 9264347698 Minions inherit enemy/notenemy from captain. 2023-08-25 11:24:15 -04:00
MagicBot 579c26ac59 InitializeMob removed. 2023-08-23 13:19:57 -04:00
MagicBot ef577dd313 Removed catch to propagate error. 2023-08-23 13:03:59 -04:00
MagicBot 62c7e52487 Starting to whittle away at initmob method. 2023-08-23 13:01:36 -04:00
MagicBot 3534ac6477 Starting to whittle away at initmob method. 2023-08-23 12:48:34 -04:00
MagicBot 1738f7b311 Starting to whittle away at initmob method. 2023-08-23 12:38:46 -04:00
MagicBot eb25caec81 Object creation moved out of rs const. 2023-08-23 12:24:43 -04:00
MagicBot a6c60e2c04 Merge remote-tracking branch 'origin/master' into mobile-cleanup 2023-08-22 07:50:46 -04:00
MagicBot adafbdf6d3 Duplicate building and building ID values. 2023-08-21 17:20:57 -04:00
MagicBot 7eab14938d Exception for siege when slotting. 2023-08-21 17:11:20 -04:00
MagicBot 039e55673b Exception for siege when slotting. 2023-08-21 17:00:27 -04:00
MagicBot ec3a9b6cb4 Minions don't have contracts. 2023-08-21 16:50:15 -04:00
MagicBot 17a6494b2b Unused code. 2023-08-21 16:41:21 -04:00
MagicBot 0b05c7074f Slot all agents but true mobiles. 2023-08-21 16:37:52 -04:00
MagicBot 876ccc7cbf New constructor created. 2023-08-21 16:12:06 -04:00
MagicBot bdf14b8f24 Ordinal comparisons refactored. 2023-08-21 15:37:21 -04:00
MagicBot 43375a6f5b Only mobiles with contracts can be slotted. 2023-08-21 15:22:08 -04:00
MagicBot e00328ae13 Siege pets use slotting mechanic. 2023-08-21 15:09:10 -04:00
MagicBot 07c553294b Mobiles use new slotting mechanic. 2023-08-21 15:04:32 -04:00
920 changed files with 28012 additions and 44234 deletions
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord; package discord;
+6 -6
View File
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord; package discord;
import engine.Enum;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.mbEnums;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.*; import java.sql.*;
@@ -70,7 +70,7 @@ public class Database {
} }
} }
public boolean updateAccountStatus(String discordAccountID, Enum.AccountStatus accountStatus) { public boolean updateAccountStatus(String discordAccountID, mbEnums.AccountStatus accountStatus) {
try (Connection connection = DriverManager.getConnection(sqlURI, ConfigManager.MB_DATABASE_USER.getValue(), try (Connection connection = DriverManager.getConnection(sqlURI, ConfigManager.MB_DATABASE_USER.getValue(),
ConfigManager.MB_DATABASE_PASS.getValue()); ConfigManager.MB_DATABASE_PASS.getValue());
@@ -131,7 +131,7 @@ public class Database {
discordAccount = new DiscordAccount(); discordAccount = new DiscordAccount();
discordAccount.discordAccount = rs.getString("discordAccount"); discordAccount.discordAccount = rs.getString("discordAccount");
discordAccount.gameAccountName = rs.getString("acct_uname"); discordAccount.gameAccountName = rs.getString("acct_uname");
discordAccount.status = Enum.AccountStatus.valueOf(rs.getString("status")); discordAccount.status = mbEnums.AccountStatus.valueOf(rs.getString("status"));
discordAccount.isDiscordAdmin = rs.getByte("discordAdmin"); // Registration date cannot be null discordAccount.isDiscordAdmin = rs.getByte("discordAdmin"); // Registration date cannot be null
Timestamp registrationDate = rs.getTimestamp("registrationDate"); Timestamp registrationDate = rs.getTimestamp("registrationDate");
@@ -328,7 +328,7 @@ public class Database {
discordAccount = new DiscordAccount(); discordAccount = new DiscordAccount();
discordAccount.discordAccount = rs.getString("discordAccount"); discordAccount.discordAccount = rs.getString("discordAccount");
discordAccount.gameAccountName = rs.getString("acct_uname"); discordAccount.gameAccountName = rs.getString("acct_uname");
discordAccount.status = Enum.AccountStatus.valueOf(rs.getString("status")); discordAccount.status = mbEnums.AccountStatus.valueOf(rs.getString("status"));
// Registration date cannot be null // Registration date cannot be null
+4 -4
View File
@@ -3,19 +3,19 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord; package discord;
import engine.Enum; import engine.mbEnums;
import java.time.LocalDateTime; import java.time.LocalDateTime;
public class DiscordAccount { public class DiscordAccount {
public String discordAccount; public String discordAccount;
public String gameAccountName; public String gameAccountName;
public Enum.AccountStatus status; public mbEnums.AccountStatus status;
public LocalDateTime registrationDate; public LocalDateTime registrationDate;
public LocalDateTime lastUpdateRequest; public LocalDateTime lastUpdateRequest;
public byte isDiscordAdmin; public byte isDiscordAdmin;
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord; package discord;
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord; package discord;
+4 -4
View File
@@ -3,15 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
import discord.Database; import discord.Database;
import discord.DiscordAccount; import discord.DiscordAccount;
import discord.MagicBot; import discord.MagicBot;
import engine.Enum; import engine.mbEnums;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import java.util.List; import java.util.List;
@@ -21,7 +21,7 @@ public class AccountInfoRequest {
public static void handleRequest(MessageReceivedEvent event) { public static void handleRequest(MessageReceivedEvent event) {
String discordAccountID = event.getAuthor().getId(); String discordAccountID = event.getAuthor().getId();
Enum.AccountStatus accountStatus; mbEnums.AccountStatus accountStatus;
if (Database.online == false) { if (Database.online == false) {
+8 -8
View File
@@ -3,15 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
import discord.DiscordAccount; import discord.DiscordAccount;
import discord.MagicBot; import discord.MagicBot;
import discord.RobotSpeak; import discord.RobotSpeak;
import engine.Enum; import engine.mbEnums;
import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -23,7 +23,7 @@ public class BanToggleHandler {
public static void handleRequest(MessageReceivedEvent event, String[] args) { public static void handleRequest(MessageReceivedEvent event, String[] args) {
String discordAccountID; String discordAccountID;
Enum.AccountStatus accountStatus; mbEnums.AccountStatus accountStatus;
// Early exit if database unavailable or is not an admin // Early exit if database unavailable or is not an admin
@@ -55,10 +55,10 @@ public class BanToggleHandler {
// toggle ban status // toggle ban status
if (discordAccounts.get(0).status.equals(Enum.AccountStatus.BANNED)) if (discordAccounts.get(0).status.equals(mbEnums.AccountStatus.BANNED))
accountStatus = Enum.AccountStatus.ACTIVE; accountStatus = mbEnums.AccountStatus.ACTIVE;
else else
accountStatus = Enum.AccountStatus.BANNED; accountStatus = mbEnums.AccountStatus.BANNED;
// We have a valid discord ID at this point. Banstick? // We have a valid discord ID at this point. Banstick?
@@ -82,7 +82,7 @@ public class BanToggleHandler {
// If we're toggling status to active we're done here. // If we're toggling status to active we're done here.
if (accountStatus.equals(Enum.AccountStatus.ACTIVE)) if (accountStatus.equals(mbEnums.AccountStatus.ACTIVE))
return; return;
// Set users role to noob // Set users role to noob
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
@@ -3,15 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
import discord.Database; import discord.Database;
import discord.DiscordAccount; import discord.DiscordAccount;
import discord.MagicBot; import discord.MagicBot;
import engine.Enum; import engine.mbEnums;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -53,7 +53,7 @@ public class PasswordChangeHandler {
// Banned or suspended user's get no love. // Banned or suspended user's get no love.
if (discordAccount.status.equals(Enum.AccountStatus.BANNED)) { if (discordAccount.status.equals(mbEnums.AccountStatus.BANNED)) {
MagicBot.sendResponse(event, MagicBot.sendResponse(event,
"Sorry but that is too much work. \n" + "Sorry but that is too much work. \n" +
"Your account detailings cannot for to log into game!"); "Your account detailings cannot for to log into game!");
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package discord.handlers; package discord.handlers;
@@ -1,706 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.InterestManagement;
import engine.Enum;
import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager;
import engine.math.Vector2f;
import engine.math.Vector3fImmutable;
import engine.objects.AbstractWorldObject;
import engine.objects.Zone;
import engine.util.MapLoader;
import org.pmw.tinylog.Logger;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
public class HeightMap {
// Class variables
// Heightmap data for all zones.
public static final HashMap<Integer, HeightMap> heightmapByLoadNum = new HashMap<>();
// Bootstrap Tracking
public static int heightMapsCreated = 0;
public static HeightMap PlayerCityHeightMap;
// Heightmap data for this heightmap
public BufferedImage heightmapImage;
private int heightMapID;
private int maxHeight;
private int fullExtentsX;
private int fullExtentsY;
private float bucketWidthX;
private float bucketWidthY;
private int zoneLoadID;
private float seaLevel = 0;
private float outsetX;
private float outsetZ;
private int[][] pixelColorValues;
public HeightMap(ResultSet rs) throws SQLException {
this.heightMapID = rs.getInt("heightMapID");
this.maxHeight = rs.getInt("maxHeight");
int halfExtentsX = rs.getInt("xRadius");
int halfExtentsY = rs.getInt("zRadius");
this.zoneLoadID = rs.getInt("zoneLoadID");
this.seaLevel = rs.getFloat("seaLevel");
this.outsetX = rs.getFloat("outsetX");
this.outsetZ = rs.getFloat("outsetZ");
// Cache the full extents to avoid the calculation
this.fullExtentsX = halfExtentsX * 2;
this.fullExtentsY = halfExtentsY * 2;
this.heightmapImage = null;
File imageFile = new File(ConfigManager.DEFAULT_DATA_DIR + "heightmaps/" + this.heightMapID + ".bmp");
// early exit if no image file was found. Will log in caller.
if (!imageFile.exists())
return;
// load the heightmap image.
try {
this.heightmapImage = ImageIO.read(imageFile);
} catch (IOException e) {
Logger.error("***Error loading heightmap data for heightmap " + this.heightMapID + e.toString());
}
// We needed to flip the image as OpenGL and Shadowbane both use the bottom left corner as origin.
this.heightmapImage = MapLoader.flipImage(this.heightmapImage);
// Calculate the data we do not load from table
float numOfBuckets = this.heightmapImage.getWidth() - 1;
float calculatedWidth = this.fullExtentsX / numOfBuckets;
this.bucketWidthX = calculatedWidth;
this.bucketWidthY = this.bucketWidthX; // This makes no sense.
// Generate pixel array from image data
generatePixelData();
HeightMap.heightmapByLoadNum.put(this.zoneLoadID, this);
heightMapsCreated++;
}
//Created for PlayerCities
public HeightMap() {
this.heightMapID = 999999;
this.maxHeight = 5; // for real...
int halfExtentsX = (int) Enum.CityBoundsType.ZONE.extents;
int halfExtentsY = (int) Enum.CityBoundsType.ZONE.extents;
this.zoneLoadID = 0;
this.seaLevel = 0;
this.outsetX = 128;
this.outsetZ = 128;
// Cache the full extents to avoid the calculation
this.fullExtentsX = halfExtentsX * 2;
this.fullExtentsY = halfExtentsY * 2;
// load the heightmap image.
// We needed to flip the image as OpenGL and Shadowbane both use the bottom left corner as origin.
this.heightmapImage = null;
// Calculate the data we do not load from table
this.bucketWidthX = 1;
this.bucketWidthY = 1;
this.pixelColorValues = new int[this.fullExtentsX + 1][this.fullExtentsY + 1];
for (int y = 0; y <= this.fullExtentsY; y++) {
for (int x = 0; x <= this.fullExtentsX; x++) {
pixelColorValues[x][y] = 255;
}
}
HeightMap.heightmapByLoadNum.put(this.zoneLoadID, this);
}
public HeightMap(Zone zone) {
this.heightMapID = 999999;
this.maxHeight = 0;
int halfExtentsX = (int) zone.getBounds().getHalfExtents().x;
int halfExtentsY = (int) zone.getBounds().getHalfExtents().y;
this.zoneLoadID = 0;
this.seaLevel = 0;
this.outsetX = 0;
this.outsetZ = 0;
// Cache the full extents to avoid the calculation
this.fullExtentsX = halfExtentsX * 2;
this.fullExtentsY = halfExtentsY * 2;
// We needed to flip the image as OpenGL and Shadowbane both use the bottom left corner as origin.
this.heightmapImage = null;
// Calculate the data we do not load from table
this.bucketWidthX = 1;
this.bucketWidthY = 1;
this.pixelColorValues = new int[this.fullExtentsX + 1][this.fullExtentsY + 1];
for (int y = 0; y <= this.fullExtentsY; y++) {
for (int x = 0; x <= this.fullExtentsX; x++) {
pixelColorValues[x][y] = 255;
}
}
HeightMap.heightmapByLoadNum.put(this.zoneLoadID, this);
}
public static void GeneratePlayerCityHeightMap() {
HeightMap.PlayerCityHeightMap = new HeightMap();
}
public static void GenerateCustomHeightMap(Zone zone) {
HeightMap heightMap = new HeightMap(zone);
HeightMap.heightmapByLoadNum.put(zone.getLoadNum(), heightMap);
}
public static Zone getNextZoneWithTerrain(Zone zone) {
Zone nextZone = zone;
if (zone.getHeightMap() != null)
return zone;
if (zone.equals(ZoneManager.getSeaFloor()))
return zone;
while (nextZone.getHeightMap() == null)
nextZone = nextZone.getParent();
return nextZone;
}
public static float getWorldHeight(AbstractWorldObject worldObject) {
Vector2f parentLoc = new Vector2f(-1, -1);
Zone currentZone = ZoneManager.findSmallestZone(worldObject.getLoc());
if (currentZone == null)
return worldObject.getAltitude();
currentZone = getNextZoneWithTerrain(currentZone);
if (currentZone == ZoneManager.getSeaFloor())
return currentZone.getAbsY() + worldObject.getAltitude();
Zone parentZone = getNextZoneWithTerrain(currentZone.getParent());
HeightMap heightMap = currentZone.getHeightMap();
Vector2f zoneLoc = ZoneManager.worldToZoneSpace(worldObject.getLoc(), currentZone);
Vector3fImmutable localLocFromCenter = ZoneManager.worldToLocal(worldObject.getLoc(), currentZone);
if ((parentZone != null) && (parentZone.getHeightMap() != null))
parentLoc = ZoneManager.worldToZoneSpace(worldObject.getLoc(), parentZone);
float interaltitude = currentZone.getHeightMap().getInterpolatedTerrainHeight(zoneLoc);
float worldAltitude = currentZone.getWorldAltitude();
float realWorldAltitude = interaltitude + worldAltitude;
//OUTSET
if (parentZone != null) {
float parentXRadius = currentZone.getBounds().getHalfExtents().x;
float parentZRadius = currentZone.getBounds().getHalfExtents().y;
float offsetX = Math.abs((localLocFromCenter.x / parentXRadius));
float offsetZ = Math.abs((localLocFromCenter.z / parentZRadius));
float bucketScaleX = heightMap.outsetX / parentXRadius;
float bucketScaleZ = heightMap.outsetZ / parentZRadius;
if (bucketScaleX <= 0.40000001)
bucketScaleX = heightMap.outsetZ / parentXRadius;
if (bucketScaleX > 0.40000001)
bucketScaleX = 0.40000001f;
if (bucketScaleZ <= 0.40000001)
bucketScaleZ = heightMap.outsetX / parentZRadius;
if (bucketScaleZ > 0.40000001)
bucketScaleZ = 0.40000001f;
float outsideGridSizeX = 1 - bucketScaleX; //32/256
float outsideGridSizeZ = 1 - bucketScaleZ;
float weight;
double scale;
if (offsetX > outsideGridSizeX && offsetX > offsetZ) {
weight = (offsetX - outsideGridSizeX) / bucketScaleX;
scale = Math.atan2((.5 - weight) * 3.1415927, 1);
float scaleChild = (float) ((scale + 1) * .5);
float scaleParent = 1 - scaleChild;
float parentAltitude = parentZone.getHeightMap().getInterpolatedTerrainHeight(parentLoc);
float parentCenterAltitude = parentZone.getHeightMap().getInterpolatedTerrainHeight(ZoneManager.worldToZoneSpace(currentZone.getLoc(), parentZone));
parentCenterAltitude += currentZone.getYCoord();
parentCenterAltitude += interaltitude;
float firstScale = parentAltitude * scaleParent;
float secondScale = parentCenterAltitude * scaleChild;
float outsetALt = firstScale + secondScale;
outsetALt += currentZone.getParent().getWorldAltitude();
realWorldAltitude = outsetALt;
} else if (offsetZ > outsideGridSizeZ) {
weight = (offsetZ - outsideGridSizeZ) / bucketScaleZ;
scale = Math.atan2((.5 - weight) * 3.1415927, 1);
float scaleChild = (float) ((scale + 1) * .5);
float scaleParent = 1 - scaleChild;
float parentAltitude = parentZone.getHeightMap().getInterpolatedTerrainHeight(parentLoc);
float parentCenterAltitude = parentZone.getHeightMap().getInterpolatedTerrainHeight(ZoneManager.worldToZoneSpace(currentZone.getLoc(), parentZone));
parentCenterAltitude += currentZone.getYCoord();
parentCenterAltitude += interaltitude;
float firstScale = parentAltitude * scaleParent;
float secondScale = parentCenterAltitude * scaleChild;
float outsetALt = firstScale + secondScale;
outsetALt += currentZone.getParent().getWorldAltitude();
realWorldAltitude = outsetALt;
}
}
return realWorldAltitude;
}
public static float getWorldHeight(Vector3fImmutable worldLoc) {
Vector2f parentLoc = new Vector2f(-1, -1);
Zone currentZone = ZoneManager.findSmallestZone(worldLoc);
if (currentZone == null)
return 0;
currentZone = getNextZoneWithTerrain(currentZone);
if (currentZone == ZoneManager.getSeaFloor())
return currentZone.getAbsY();
Zone parentZone = getNextZoneWithTerrain(currentZone.getParent());
HeightMap heightMap = currentZone.getHeightMap();
if ((heightMap == null) || (currentZone == ZoneManager.getSeaFloor()))
return currentZone.getAbsY();
Vector2f zoneLoc = ZoneManager.worldToZoneSpace(worldLoc, currentZone);
Vector3fImmutable localLocFromCenter = ZoneManager.worldToLocal(worldLoc, currentZone);
if ((parentZone != null) && (parentZone.getHeightMap() != null))
parentLoc = ZoneManager.worldToZoneSpace(worldLoc, parentZone);
float interaltitude = currentZone.getHeightMap().getInterpolatedTerrainHeight(zoneLoc);
float worldAltitude = currentZone.getWorldAltitude();
float realWorldAltitude = interaltitude + worldAltitude;
//OUTSET
if (parentZone != null) {
// if (currentZone.getHeightMap() != null && parentZone.getHeightMap() != null && parentZone.getParent() != null && parentZone.getParent().getHeightMap() != null)
// return realWorldAltitude;
float parentXRadius = currentZone.getBounds().getHalfExtents().x;
float parentZRadius = currentZone.getBounds().getHalfExtents().y;
float offsetX = Math.abs((localLocFromCenter.x / parentXRadius));
float offsetZ = Math.abs((localLocFromCenter.z / parentZRadius));
float bucketScaleX = heightMap.outsetX / parentXRadius;
float bucketScaleZ = heightMap.outsetZ / parentZRadius;
float outsideGridSizeX = 1 - bucketScaleX; //32/256
float outsideGridSizeZ = 1 - bucketScaleZ;
float weight;
double scale;
if (offsetX > outsideGridSizeX && offsetX > offsetZ) {
weight = (offsetX - outsideGridSizeX) / bucketScaleX;
scale = Math.atan2((.5 - weight) * 3.1415927, 1);
float scaleChild = (float) ((scale + 1) * .5);
float scaleParent = 1 - scaleChild;
float parentAltitude = parentZone.getHeightMap().getInterpolatedTerrainHeight(parentLoc);
float parentCenterAltitude = parentZone.getHeightMap().getInterpolatedTerrainHeight(ZoneManager.worldToZoneSpace(currentZone.getLoc(), parentZone));
parentCenterAltitude += currentZone.getYCoord();
parentCenterAltitude += interaltitude;
float firstScale = parentAltitude * scaleParent;
float secondScale = parentCenterAltitude * scaleChild;
float outsetALt = firstScale + secondScale;
outsetALt += currentZone.getParent().getWorldAltitude();
realWorldAltitude = outsetALt;
} else if (offsetZ > outsideGridSizeZ) {
weight = (offsetZ - outsideGridSizeZ) / bucketScaleZ;
scale = Math.atan2((.5 - weight) * 3.1415927, 1);
float scaleChild = (float) ((scale + 1) * .5);
float scaleParent = 1 - scaleChild;
float parentAltitude = parentZone.getHeightMap().getInterpolatedTerrainHeight(parentLoc);
float parentCenterAltitude = parentZone.getHeightMap().getInterpolatedTerrainHeight(ZoneManager.worldToZoneSpace(currentZone.getLoc(), parentZone));
parentCenterAltitude += currentZone.getYCoord();
parentCenterAltitude += interaltitude;
float firstScale = parentAltitude * scaleParent;
float secondScale = parentCenterAltitude * scaleChild;
float outsetALt = firstScale + secondScale;
outsetALt += currentZone.getParent().getWorldAltitude();
realWorldAltitude = outsetALt;
}
}
return realWorldAltitude;
}
public static float getOutsetHeight(float interpolatedAltitude, Zone zone, Vector3fImmutable worldLocation) {
Vector2f parentLoc;
float outsetALt = 0;
if (zone.getParent() == null || zone.getParent().getHeightMap() == null)
return interpolatedAltitude + zone.getWorldAltitude();
if (zone.getParent() != null && zone.getParent().getHeightMap() != null) {
parentLoc = ZoneManager.worldToZoneSpace(worldLocation, zone.getParent());
Vector3fImmutable localLocFromCenter = ZoneManager.worldToLocal(worldLocation, zone);
float parentXRadius = zone.getBounds().getHalfExtents().x;
float parentZRadius = zone.getBounds().getHalfExtents().y;
float bucketScaleX = zone.getHeightMap().outsetX / parentXRadius;
float bucketScaleZ = zone.getHeightMap().outsetZ / parentZRadius;
float outsideGridSizeX = 1 - bucketScaleX; //32/256
float outsideGridSizeZ = 1 - bucketScaleZ;
float weight;
double scale;
float offsetX = Math.abs((localLocFromCenter.x / parentXRadius));
float offsetZ = Math.abs((localLocFromCenter.z / parentZRadius));
if (offsetX > outsideGridSizeX && offsetX > offsetZ) {
weight = (offsetX - outsideGridSizeX) / bucketScaleX;
scale = Math.atan2((.5 - weight) * 3.1415927, 1);
float scaleChild = (float) ((scale + 1) * .5);
float scaleParent = 1 - scaleChild;
float parentAltitude = zone.getParent().getHeightMap().getInterpolatedTerrainHeight(parentLoc);
float parentCenterAltitude = zone.getParent().getHeightMap().getInterpolatedTerrainHeight(ZoneManager.worldToZoneSpace(zone.getLoc(), zone.getParent()));
parentCenterAltitude += zone.getYCoord();
parentCenterAltitude += interpolatedAltitude;
float firstScale = parentAltitude * scaleParent;
float secondScale = parentCenterAltitude * scaleChild;
outsetALt = firstScale + secondScale;
outsetALt += zone.getParent().getAbsY();
} else if (offsetZ > outsideGridSizeZ) {
weight = (offsetZ - outsideGridSizeZ) / bucketScaleZ;
scale = Math.atan2((.5 - weight) * 3.1415927, 1);
float scaleChild = (float) ((scale + 1) * .5);
float scaleParent = 1 - scaleChild;
float parentAltitude = zone.getParent().getHeightMap().getInterpolatedTerrainHeight(parentLoc);
float parentCenterAltitude = zone.getHeightMap().getInterpolatedTerrainHeight(ZoneManager.worldToZoneSpace(zone.getLoc(), zone));
parentCenterAltitude += zone.getYCoord();
parentCenterAltitude += interpolatedAltitude;
float firstScale = parentAltitude * scaleParent;
float secondScale = parentCenterAltitude * scaleChild;
outsetALt = firstScale + secondScale;
outsetALt += zone.getParent().getAbsY();
}
}
return outsetALt;
}
public static Vector2f getGridOffset(Vector2f gridSquare) {
int floorX = (int) gridSquare.x;
int floorY = (int) gridSquare.y;
return new Vector2f(gridSquare.x - floorX, gridSquare.y - floorY);
}
public static void loadAlHeightMaps() {
// Load the heightmaps into staging hashmap keyed by HashMapID
DbManager.HeightMapQueries.LOAD_ALL_HEIGHTMAPS();
//generate static player city heightmap.
HeightMap.GeneratePlayerCityHeightMap();
// Clear all heightmap image data as it's no longer needed.
for (HeightMap heightMap : HeightMap.heightmapByLoadNum.values()) {
heightMap.heightmapImage = null;
}
Logger.info(HeightMap.heightmapByLoadNum.size() + " Heightmaps cached.");
}
public static boolean isLocUnderwater(Vector3fImmutable currentLoc) {
float localAltitude = HeightMap.getWorldHeight(currentLoc);
Zone zone = ZoneManager.findSmallestZone(currentLoc);
if (localAltitude < zone.getSeaLevel())
return true;
return false;
}
public Vector2f getGridSquare(Vector2f zoneLoc) {
if (zoneLoc.x < 0)
zoneLoc.setX(0);
if (zoneLoc.x > this.fullExtentsX - 1)
zoneLoc.setX((this.fullExtentsX - 1) + .9999999f);
if (zoneLoc.y < 0)
zoneLoc.setY(0);
if (zoneLoc.y > this.fullExtentsY - 1)
zoneLoc.setY((this.fullExtentsY - 1) + .9999999f);
float xBucket = (zoneLoc.x / this.bucketWidthX);
float yBucket = (zoneLoc.y / this.bucketWidthY);
return new Vector2f(xBucket, yBucket);
}
public float getInterpolatedTerrainHeight(Vector2f zoneLoc) {
Vector2f gridSquare;
if (zoneLoc.x < 0 || zoneLoc.x > this.fullExtentsX)
return -1;
if (zoneLoc.y < 0 || zoneLoc.y > this.fullExtentsY)
return -1;
int maxX = (int) (this.fullExtentsX / this.bucketWidthX);
int maxY = (int) (this.fullExtentsY / this.bucketWidthY);
//flip the Y so it grabs from the bottom left instead of top left.
//zoneLoc.setY(maxZoneHeight - zoneLoc.y);
gridSquare = getGridSquare(zoneLoc);
int gridX = (int) gridSquare.x;
int gridY = (int) (gridSquare.y);
if (gridX > maxX)
gridX = maxX;
if (gridY > maxY)
gridY = maxY;
float offsetX = (gridSquare.x - gridX);
float offsetY = gridSquare.y - gridY;
//get height of the 4 vertices.
float topLeftHeight = 0;
float topRightHeight = 0;
float bottomLeftHeight = 0;
float bottomRightHeight = 0;
int nextY = gridY + 1;
int nextX = gridX + 1;
if (nextY > maxY)
nextY = gridY;
if (nextX > maxX)
nextX = gridX;
topLeftHeight = pixelColorValues[gridX][gridY];
topRightHeight = pixelColorValues[nextX][gridY];
bottomLeftHeight = pixelColorValues[gridX][nextY];
bottomRightHeight = pixelColorValues[nextX][nextY];
float interpolatedHeight;
interpolatedHeight = topRightHeight * (1 - offsetY) * (offsetX);
interpolatedHeight += (bottomRightHeight * offsetY * offsetX);
interpolatedHeight += (bottomLeftHeight * (1 - offsetX) * offsetY);
interpolatedHeight += (topLeftHeight * (1 - offsetX) * (1 - offsetY));
interpolatedHeight *= (float) this.maxHeight / 256; // Scale height
return interpolatedHeight;
}
public float getInterpolatedTerrainHeight(Vector3fImmutable zoneLoc3f) {
Vector2f zoneLoc = new Vector2f(zoneLoc3f.x, zoneLoc3f.z);
Vector2f gridSquare;
if (zoneLoc.x < 0 || zoneLoc.x > this.fullExtentsX)
return -1;
if (zoneLoc.y < 0 || zoneLoc.y > this.fullExtentsY)
return -1;
//flip the Y so it grabs from the bottom left instead of top left.
//zoneLoc.setY(maxZoneHeight - zoneLoc.y);
gridSquare = getGridSquare(zoneLoc);
int gridX = (int) gridSquare.x;
int gridY = (int) (gridSquare.y);
float offsetX = (gridSquare.x - gridX);
float offsetY = gridSquare.y - gridY;
//get height of the 4 vertices.
float topLeftHeight = pixelColorValues[gridX][gridY];
float topRightHeight = pixelColorValues[gridX + 1][gridY];
float bottomLeftHeight = pixelColorValues[gridX][gridY + 1];
float bottomRightHeight = pixelColorValues[gridX + 1][gridY + 1];
float interpolatedHeight;
interpolatedHeight = topRightHeight * (1 - offsetY) * (offsetX);
interpolatedHeight += (bottomRightHeight * offsetY * offsetX);
interpolatedHeight += (bottomLeftHeight * (1 - offsetX) * offsetY);
interpolatedHeight += (topLeftHeight * (1 - offsetX) * (1 - offsetY));
interpolatedHeight *= (float) this.maxHeight / 256; // Scale height
return interpolatedHeight;
}
private void generatePixelData() {
Color color;
// Generate altitude lookup table for this heightmap
this.pixelColorValues = new int[this.heightmapImage.getWidth()][this.heightmapImage.getHeight()];
for (int y = 0; y < this.heightmapImage.getHeight(); y++) {
for (int x = 0; x < this.heightmapImage.getWidth(); x++) {
color = new Color(this.heightmapImage.getRGB(x, y));
pixelColorValues[x][y] = color.getRed();
}
}
}
public float getScaledHeightForColor(float color) {
return (color / 256) * this.maxHeight;
}
public float getBucketWidthX() {
return bucketWidthX;
}
public float getBucketWidthY() {
return bucketWidthY;
}
public int getHeightMapID() {
return heightMapID;
}
public BufferedImage getHeightmapImage() {
return heightmapImage;
}
public float getSeaLevel() {
return seaLevel;
}
}
@@ -3,23 +3,26 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.InterestManagement; package engine.InterestManagement;
import engine.Enum; import engine.gameManager.DispatchManager;
import engine.Enum.DispatchChannel;
import engine.Enum.GameObjectType;
import engine.gameManager.GroupManager; import engine.gameManager.GroupManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.job.JobScheduler; import engine.job.JobScheduler;
import engine.jobs.RefreshGroupJob; import engine.jobs.RefreshGroupJob;
import engine.mbEnums;
import engine.mbEnums.DispatchChannel;
import engine.mbEnums.GameObjectType;
import engine.net.AbstractNetMsg; import engine.net.AbstractNetMsg;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.*; import engine.net.client.msg.LoadCharacterMsg;
import engine.net.client.msg.LoadStructureMsg;
import engine.net.client.msg.MoveToPointMsg;
import engine.net.client.msg.UnloadObjectsMsg;
import engine.objects.*; import engine.objects.*;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -85,7 +88,7 @@ public enum InterestManager implements Runnable {
if (send) { if (send) {
Dispatch dispatch = Dispatch.borrow(player, msg); Dispatch dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} }
} }
} }
@@ -137,7 +140,7 @@ public enum InterestManager implements Runnable {
else { else {
if (pc != null) if (pc != null)
if (pcc.getSeeInvis() < pc.getHidden()) if (pcc.getSeeInvis() < pc.hidden)
continue; continue;
if (!cc.sendMsg(uom)) { if (!cc.sendMsg(uom)) {
@@ -267,7 +270,7 @@ public enum InterestManager implements Runnable {
} }
Dispatch dispatch = Dispatch.borrow(player, uom); Dispatch dispatch = Dispatch.borrow(player, uom);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} }
loadedStaticObjects.removeAll(toRemove); loadedStaticObjects.removeAll(toRemove);
@@ -289,7 +292,7 @@ public enum InterestManager implements Runnable {
lcm = new LoadCharacterMsg(corpse, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(corpse, PlayerCharacter.hideNonAscii());
Dispatch dispatch = Dispatch.borrow(player, lcm); Dispatch dispatch = Dispatch.borrow(player, lcm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} else if (awo.getObjectType().equals(GameObjectType.NPC)) { } else if (awo.getObjectType().equals(GameObjectType.NPC)) {
NPC npc = (NPC) awo; NPC npc = (NPC) awo;
@@ -301,13 +304,13 @@ public enum InterestManager implements Runnable {
if (lsm.getStructureList().size() > 0) { if (lsm.getStructureList().size() > 0) {
Dispatch dispatch = Dispatch.borrow(player, lsm); Dispatch dispatch = Dispatch.borrow(player, lsm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} }
for (LoadCharacterMsg lc : lcmList) { for (LoadCharacterMsg lc : lcmList) {
Dispatch dispatch = Dispatch.borrow(player, lc); Dispatch dispatch = Dispatch.borrow(player, lc);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} }
loadedStaticObjects.addAll(toLoad); loadedStaticObjects.addAll(toLoad);
@@ -337,7 +340,7 @@ public enum InterestManager implements Runnable {
if (loadedPlayer.getObjectUUID() == player.getObjectUUID()) if (loadedPlayer.getObjectUUID() == player.getObjectUUID())
continue; continue;
if (player.getSeeInvis() < loadedPlayer.getHidden()) if (player.getSeeInvis() < loadedPlayer.hidden)
continue; continue;
if (loadedPlayer.safemodeInvis()) if (loadedPlayer.safemodeInvis())
@@ -369,7 +372,7 @@ public enum InterestManager implements Runnable {
if (playerLoadedObject.getObjectType().equals(GameObjectType.PlayerCharacter)) { if (playerLoadedObject.getObjectType().equals(GameObjectType.PlayerCharacter)) {
PlayerCharacter loadedPlayer = (PlayerCharacter) playerLoadedObject; PlayerCharacter loadedPlayer = (PlayerCharacter) playerLoadedObject;
if (player.getSeeInvis() < loadedPlayer.getHidden()) if (player.getSeeInvis() < loadedPlayer.hidden)
toRemove.add(playerLoadedObject); toRemove.add(playerLoadedObject);
else if (loadedPlayer.safemodeInvis()) else if (loadedPlayer.safemodeInvis())
toRemove.add(playerLoadedObject); toRemove.add(playerLoadedObject);
@@ -411,7 +414,7 @@ public enum InterestManager implements Runnable {
if (!uom.getObjectList().isEmpty()) { if (!uom.getObjectList().isEmpty()) {
Dispatch dispatch = Dispatch.borrow(player, uom); Dispatch dispatch = Dispatch.borrow(player, uom);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} }
} }
@@ -434,7 +437,7 @@ public enum InterestManager implements Runnable {
// dont load if invis // dont load if invis
if (player.getSeeInvis() < awopc.getHidden()) if (player.getSeeInvis() < awopc.hidden)
continue; continue;
lcm = new LoadCharacterMsg(awopc, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(awopc, PlayerCharacter.hideNonAscii());
@@ -464,7 +467,7 @@ public enum InterestManager implements Runnable {
if (awonpc.despawned == true) if (awonpc.despawned == true)
continue; continue;
awonpc.playerAgroMap.put(player.getObjectUUID(), false); awonpc.playerAgroMap.put(player.getObjectUUID(), 0f);
((Mob) awonpc).setCombatTarget(null); ((Mob) awonpc).setCombatTarget(null);
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii());
@@ -477,9 +480,9 @@ public enum InterestManager implements Runnable {
if (!awonpc.isAlive()) if (!awonpc.isAlive())
continue; continue;
awonpc.playerAgroMap.put(player.getObjectUUID(), false); awonpc.playerAgroMap.put(player.getObjectUUID(), 0f);
if ((awonpc.agentType.equals(Enum.AIAgentType.MOBILE))) if ((awonpc.agentType.equals(mbEnums.AIAgentType.MOBILE)))
((Mob) awonpc).setCombatTarget(null); ((Mob) awonpc).setCombatTarget(null);
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii());
@@ -489,7 +492,7 @@ public enum InterestManager implements Runnable {
if (lcm != null) { if (lcm != null) {
Dispatch dispatch = Dispatch.borrow(player, lcm); Dispatch dispatch = Dispatch.borrow(player, lcm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} }
@@ -518,10 +521,10 @@ public enum InterestManager implements Runnable {
// Update loaded upbjects lists // Update loaded upbjects lists
player.isBoxed = PlayerCharacter.checkIfBoxed(player);
player.setDirtyLoad(true); player.setDirtyLoad(true);
updateStaticList(player, origin); updateStaticList(player, origin);
updateMobileList(player, origin); updateMobileList(player, origin);
} }
public synchronized void HandleLoadForTeleport(PlayerCharacter playerCharacter) { public synchronized void HandleLoadForTeleport(PlayerCharacter playerCharacter) {
+18 -15
View File
@@ -3,19 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.InterestManagement; package engine.InterestManagement;
/* This class is the main interface for Magicbane's import engine.gameManager.DispatchManager;
* Interest management facilities.
*/
import engine.Enum;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.msg.TerritoryChangeMessage; import engine.net.client.msg.TerritoryChangeMessage;
import engine.objects.City; import engine.objects.City;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@@ -31,10 +27,17 @@ import static engine.objects.Realm.getRealm;
public enum RealmMap { public enum RealmMap {
REALM_MAP; // MB Dev Notes:
// This class loads and caches realm maps used by each
// map set for its realm overlay. The RealmMap loaded is
// controlled by config entry MB_WORLD_REALMMAP
//
// Unlike a Heightmap this is a just color lookup; identical to
// the old image maps used in 90s web technology.
//
// Realm Map images are stored on disk in /mb.data/realmmaps/
// Spatial hashmap. Used for determining which Realm REALM_MAP;
// a player is currently located within.
private static final HashMap<Color, Integer> _rgbToIDMap = new HashMap<>(); private static final HashMap<Color, Integer> _rgbToIDMap = new HashMap<>();
public static int[][] _realmImageMap; public static int[][] _realmImageMap;
@@ -65,7 +68,7 @@ public enum RealmMap {
public static Realm getRealmForCity(City city) { public static Realm getRealmForCity(City city) {
Realm outRealm = null; Realm outRealm = null;
outRealm = city.getRealm(); outRealm = city.realm;
return outRealm; return outRealm;
} }
@@ -88,17 +91,17 @@ public enum RealmMap {
if (city != null) { if (city != null) {
TerritoryChangeMessage tcm = new TerritoryChangeMessage((PlayerCharacter) realm.getRulingCity().getOwner(), realm); TerritoryChangeMessage tcm = new TerritoryChangeMessage((PlayerCharacter) realm.getRulingCity().getOwner(), realm);
Dispatch dispatch = Dispatch.borrow(player, tcm); Dispatch dispatch = Dispatch.borrow(player, tcm);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} else { } else {
TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm); TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm);
Dispatch dispatch = Dispatch.borrow(player, tcm); Dispatch dispatch = Dispatch.borrow(player, tcm);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} }
} else { } else {
TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm); TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm);
Dispatch dispatch = Dispatch.borrow(player, tcm); Dispatch dispatch = Dispatch.borrow(player, tcm);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} }
} }
+238
View File
@@ -0,0 +1,238 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2026
// https://www.magicbane.com
package engine.InterestManagement;
import engine.gameManager.ZoneManager;
import engine.math.Vector2f;
import engine.math.Vector3fImmutable;
import engine.objects.Zone;
import org.pmw.tinylog.Logger;
import java.util.HashMap;
import static java.lang.Math.PI;
// MB Dev Notes:
// The Terrain class handles lookups into the Heightmap data.
// It supports all current maps along with the differences in
// their parenting configuration.
//
// Heightmap images are stored on disk in /mb.data/heightmaps/
public class Terrain {
public static final HashMap<Integer, short[][]> _heightmap_pixel_cache = new HashMap<>();
public short[][] terrain_pixel_data;
public Vector2f terrain_size = new Vector2f();
public Vector2f cell_size = new Vector2f();
public Vector2f cell_count = new Vector2f();
public float terrain_scale;
public Vector2f blend_values = new Vector2f();
public Vector2f blend_ratio = new Vector2f();
public int heightmap;
Zone zone;
public Terrain(Zone zone) {
this.zone = zone;
this.heightmap = this.zone.template.terrain_image;
// Configure PLANAR zones to use the same 16x16 pixel image
// that all similar terrains share. (See JSON)
if (this.zone.template.terrain_type.equals("PLANAR"))
this.heightmap = 1006300; // all 0
// Load pixel data for this terrain from cache
this.terrain_pixel_data = Terrain._heightmap_pixel_cache.get(heightmap);
if (terrain_pixel_data == null)
Logger.error("Pixel map empty for zone: " + this.zone.getObjectUUID() + ":" + this.zone.zoneName);
// Configure terrain based on zone properties
this.terrain_size.x = this.zone.major_radius * 2;
this.terrain_size.y = this.zone.minor_radius * 2;
this.cell_count.x = this.terrain_pixel_data.length - 1;
this.cell_count.y = this.terrain_pixel_data[0].length - 1;
this.cell_size.x = terrain_size.x / this.cell_count.x;
this.cell_size.y = terrain_size.y / this.cell_count.y;
// Blending configuration. These ratios are used to calculate
// the blending area between child and parent terrains when
// they are stitched together.
this.blend_values.x = this.zone.template.max_blend;
this.blend_values.y = this.zone.template.min_blend;
Vector2f major_blend = new Vector2f(this.blend_values.x / this.zone.major_radius,
this.blend_values.y / this.zone.major_radius);
Vector2f minor_blend = new Vector2f(this.blend_values.x / this.zone.minor_radius,
this.blend_values.y / this.zone.minor_radius);
if (major_blend.y > 0.4f)
blend_ratio.x = major_blend.y;
else
blend_ratio.x = Math.min(major_blend.x, 0.4f);
if (minor_blend.y > 0.4f)
blend_ratio.y = minor_blend.y;
else
blend_ratio.y = Math.min(minor_blend.x, 0.4f);
// Scale coefficient for this terrain
this.terrain_scale = this.zone.template.terrain_max_y / 255f;
}
public static Zone getNextZoneWithTerrain(Zone zone) {
// Not all zones have a terrain. Some are for display only
// and heights returned are from the parent heightmap. This
// is controlled in the JSON via the has_terrain_gen field.
Zone terrain_zone = zone;
if (zone == null)
return ZoneManager.seaFloor;
if (zone.terrain != null)
return zone;
if (zone.equals(ZoneManager.seaFloor))
return zone;
while (terrain_zone.terrain == null)
terrain_zone = terrain_zone.parent;
return terrain_zone;
}
public static float getWorldHeight(Zone zone, Vector3fImmutable world_loc) {
// Retrieve the next zone up in the tree with a terrain defined.
Zone terrainZone = getNextZoneWithTerrain(zone);
Zone parentZone = getNextZoneWithTerrain(zone.parent);
// Transform world loc into zone space coordinate system
Vector2f terrainLoc = ZoneManager.worldToTerrainSpace(world_loc, terrainZone);
Vector2f parentLoc = ZoneManager.worldToTerrainSpace(world_loc, parentZone);
// Offset from origin needed for blending function
Vector2f terrainOffset = ZoneManager.worldToZoneOffset(world_loc, terrainZone);
// Interpolate height for this position in both terrains
float interpolatedChildHeight = terrainZone.terrain.getInterpolatedTerrainHeight(terrainLoc);
interpolatedChildHeight += terrainZone.global_height;
float interpolatedParentTerrainHeight = parentZone.terrain.getInterpolatedTerrainHeight(parentLoc);
interpolatedParentTerrainHeight += parentZone.global_height;
// Blend between terrains
float blendCoefficient = terrainZone.terrain.getTerrainBlendCoefficient(terrainOffset);
float terrainHeight = interpolatedChildHeight * blendCoefficient;
terrainHeight += interpolatedParentTerrainHeight * (1 - blendCoefficient);
return terrainHeight;
}
public static float getWorldHeight(Vector3fImmutable world_loc) {
Zone currentZone = ZoneManager.findSmallestZone(world_loc);
return getWorldHeight(currentZone, world_loc);
}
public Vector2f getTerrainCell(Vector2f terrain_loc) {
// Calculate terrain cell with offset
Vector2f terrain_cell = new Vector2f(terrain_loc.x / this.cell_size.x, terrain_loc.y / this.cell_size.y);
// Clamp values when standing directly on pole
terrain_cell.x = Math.max(0, Math.min(this.cell_count.x - 1, terrain_cell.x));
terrain_cell.y = Math.max(0, Math.min(this.cell_count.y - 1, terrain_cell.y));
return terrain_cell;
}
public float getInterpolatedTerrainHeight(Vector2f terrain_loc) {
float interpolatedHeight;
// Early exit for guild zones
if (this.zone.guild_zone)
return 5.0f;
// Determine terrain and offset from top left vertex
Vector2f terrain_cell = getTerrainCell(terrain_loc);
int pixel_x = (int) Math.floor(terrain_cell.x);
int pixel_y = (int) Math.floor(terrain_cell.y);
Vector2f pixel_offset = new Vector2f(terrain_cell.x % 1, terrain_cell.y % 1);
// 4 surrounding vertices from the pixel array.
short top_left_pixel = terrain_pixel_data[pixel_x][pixel_y];
short top_right_pixel = terrain_pixel_data[pixel_x + 1][pixel_y];
short bottom_left_pixel = terrain_pixel_data[pixel_x][pixel_y + 1];
short bottom_right_pixel = terrain_pixel_data[pixel_x + 1][pixel_y + 1];
// Interpolate between the 4 vertices
interpolatedHeight = top_left_pixel * (1 - pixel_offset.x) * (1 - pixel_offset.y);
interpolatedHeight += top_right_pixel * (1 - pixel_offset.y) * (pixel_offset.x);
interpolatedHeight += (bottom_left_pixel * (1 - pixel_offset.x) * pixel_offset.y);
interpolatedHeight += (bottom_right_pixel * pixel_offset.y * pixel_offset.x);
interpolatedHeight *= this.terrain_scale; // Scale height
return interpolatedHeight;
}
public float getTerrainBlendCoefficient(Vector2f zone_offset) {
// Normalize terrain offset
Vector2f normalizedOffset = new Vector2f(Math.abs(zone_offset.x) / this.zone.template.major_radius,
Math.abs(zone_offset.y) / this.zone.template.minor_radius);
float blendCoefficient;
if (normalizedOffset.x <= 1 - blend_ratio.x || normalizedOffset.x <= normalizedOffset.y) {
if (normalizedOffset.y < 1 - blend_ratio.y)
return 1;
blendCoefficient = (normalizedOffset.y - (1 - blend_ratio.y)) / blend_ratio.y;
} else
blendCoefficient = (normalizedOffset.x - (1 - blend_ratio.x)) / blend_ratio.x;
blendCoefficient = (float) Math.atan((0.5f - blendCoefficient) * PI);
return (blendCoefficient + 1) * 0.5f;
}
}
+13 -13
View File
@@ -3,16 +3,16 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.InterestManagement; package engine.InterestManagement;
import engine.Enum.GridObjectType; import engine.gameManager.DispatchManager;
import engine.math.FastMath; import engine.math.FastMath;
import engine.math.Vector3f; import engine.math.Vector3f;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.DispatchMessage; import engine.mbEnums.GridObjectType;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.LoadCharacterMsg; import engine.net.client.msg.LoadCharacterMsg;
import engine.net.client.msg.LoadStructureMsg; import engine.net.client.msg.LoadStructureMsg;
@@ -201,7 +201,7 @@ public class WorldGrid {
UnloadObjectsMsg uom = new UnloadObjectsMsg(); UnloadObjectsMsg uom = new UnloadObjectsMsg();
uom.addObject(awo); uom.addObject(awo);
DispatchMessage.sendToAllInRange(awo, uom); DispatchManager.sendToAllInRange(awo, uom);
} }
public static void loadObject(AbstractWorldObject awo) { public static void loadObject(AbstractWorldObject awo) {
@@ -213,15 +213,15 @@ public class WorldGrid {
case Building: case Building:
lsm = new LoadStructureMsg(); lsm = new LoadStructureMsg();
lsm.addObject((Building) awo); lsm.addObject((Building) awo);
DispatchMessage.sendToAllInRange(awo, lsm); DispatchManager.sendToAllInRange(awo, lsm);
break; break;
case NPC: case NPC:
lcm = new LoadCharacterMsg((NPC) awo, false); lcm = new LoadCharacterMsg((NPC) awo, false);
DispatchMessage.sendToAllInRange(awo, lcm); DispatchManager.sendToAllInRange(awo, lcm);
break; break;
case Mob: case Mob:
lcm = new LoadCharacterMsg((Mob) awo, false); lcm = new LoadCharacterMsg((Mob) awo, false);
DispatchMessage.sendToAllInRange(awo, lcm); DispatchManager.sendToAllInRange(awo, lcm);
break; break;
default: default:
// *** Refactor: Log error? // *** Refactor: Log error?
@@ -239,19 +239,19 @@ public class WorldGrid {
case Building: case Building:
lsm = new LoadStructureMsg(); lsm = new LoadStructureMsg();
lsm.addObject((Building) awo); lsm.addObject((Building) awo);
DispatchMessage.sendToAllInRange(awo, lsm); DispatchManager.sendToAllInRange(awo, lsm);
break; break;
case NPC: case NPC:
lcm = new LoadCharacterMsg((NPC) awo, false); lcm = new LoadCharacterMsg((NPC) awo, false);
DispatchMessage.sendToAllInRange(awo, lcm); DispatchManager.sendToAllInRange(awo, lcm);
break; break;
case Mob: case Mob:
lcm = new LoadCharacterMsg((Mob) awo, false); lcm = new LoadCharacterMsg((Mob) awo, false);
DispatchMessage.sendToAllInRange(awo, lcm); DispatchManager.sendToAllInRange(awo, lcm);
break; break;
case PlayerCharacter: case PlayerCharacter:
lcm = new LoadCharacterMsg((PlayerCharacter) awo, false); lcm = new LoadCharacterMsg((PlayerCharacter) awo, false);
DispatchMessage.sendToAllInRange(awo, lcm); DispatchManager.sendToAllInRange(awo, lcm);
break; break;
default: default:
// *** Refactor: Log error? // *** Refactor: Log error?
@@ -263,7 +263,7 @@ public class WorldGrid {
ClientConnection origin) { ClientConnection origin) {
UnloadObjectsMsg uom = new UnloadObjectsMsg(); UnloadObjectsMsg uom = new UnloadObjectsMsg();
uom.addObject(awo); uom.addObject(awo);
DispatchMessage.sendToAllInRange(awo, uom); DispatchManager.sendToAllInRange(awo, uom);
} }
public static void addObject(AbstractWorldObject awo, PlayerCharacter pc) { public static void addObject(AbstractWorldObject awo, PlayerCharacter pc) {
-116
View File
@@ -1,116 +0,0 @@
package engine.ZergMehcanics;
import engine.InterestManagement.WorldGrid;
import engine.gameManager.BuildingManager;
import engine.gameManager.ZergManager;
import engine.objects.*;
import engine.server.MBServerStatics;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
public class MineAntiZerg {
public static HashMap<Mine,HashMap<PlayerCharacter,Long>> leaveTimers = new HashMap<>();
public static HashMap<Mine,ArrayList<PlayerCharacter>> currentPlayers = new HashMap<>();
public static void runMines(){
for(Mine mine : Mine.getMines()){
Building tower = BuildingManager.getBuildingFromCache(mine.getBuildingID());
if(tower == null)
continue;
if(!mine.isActive)
continue;
logPlayersPresent(tower,mine);
auditPlayersPresent(tower,mine);
auditPlayers(mine);
}
}
public static void logPlayersPresent(Building tower, Mine mine){
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(tower.loc, MBServerStatics.CHARACTER_LOAD_RANGE * 3,MBServerStatics.MASK_PLAYER);
ArrayList<PlayerCharacter> playersPresent = new ArrayList<>();
for(AbstractWorldObject player : loadedPlayers){
playersPresent.add((PlayerCharacter)player);
}
currentPlayers.put(mine,playersPresent);
}
public static void auditPlayersPresent(Building tower, Mine mine){
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(tower.loc, MBServerStatics.CHARACTER_LOAD_RANGE * 3,MBServerStatics.MASK_PLAYER);
ArrayList<PlayerCharacter> toRemove = new ArrayList<>();
for(PlayerCharacter player : currentPlayers.get(mine)){
if(!loadedPlayers.contains(player)){
toRemove.add(player);
}
}
currentPlayers.get(mine).removeAll(toRemove);
for(PlayerCharacter player : toRemove){
if(leaveTimers.containsKey(mine)){
leaveTimers.get(mine).put(player,System.currentTimeMillis());
}else{
HashMap<PlayerCharacter,Long> leaveTime = new HashMap<>();
leaveTime.put(player,System.currentTimeMillis());
leaveTimers.put(mine,leaveTime);
}
}
toRemove.clear();
for(PlayerCharacter player : leaveTimers.get(mine).keySet()){
long timeGone = System.currentTimeMillis() - leaveTimers.get(mine).get(player);
if(timeGone > 180000L) {//3 minutes
toRemove.add(player);
player.ZergMultiplier = 1.0f;
}
}
for(PlayerCharacter player : toRemove) {
leaveTimers.get(mine).remove(player);
}
}
public static void auditPlayers(Mine mine){
HashMap<Guild,ArrayList<PlayerCharacter>> playersByNation = new HashMap<>();
for(PlayerCharacter player : currentPlayers.get(mine)){
if(playersByNation.containsKey(player.guild.getNation())){
playersByNation.get(player.guild.getNation()).add(player);
}else{
ArrayList<PlayerCharacter> players = new ArrayList<>();
players.add(player);
playersByNation.put(player.guild.getNation(),players);
}
}
for(PlayerCharacter player : leaveTimers.get(mine).keySet()){
if(playersByNation.containsKey(player.guild.getNation())){
playersByNation.get(player.guild.getNation()).add(player);
}else{
ArrayList<PlayerCharacter> players = new ArrayList<>();
players.add(player);
playersByNation.put(player.guild.getNation(),players);
}
}
for(Guild nation : playersByNation.keySet()){
for(PlayerCharacter player : playersByNation.get(nation)){
player.ZergMultiplier = ZergManager.getCurrentMultiplier(playersByNation.get(nation).size(), mine.capSize);
}
}
}
}
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.core; package engine.core;
+16 -17
View File
@@ -3,25 +3,24 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Bane; import engine.objects.Bane;
import engine.objects.City; import engine.objects.City;
import engine.workthreads.WarehousePushThread; import engine.workthreads.WarehousePushThread;
import org.joda.time.DateTime;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.*; import java.sql.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import static engine.Enum.RecordEventType; import static engine.mbEnums.RecordEventType;
public class BaneRecord extends DataRecord { public class BaneRecord extends DataRecord {
@@ -34,11 +33,11 @@ public class BaneRecord extends DataRecord {
private String baneDropperHash; private String baneDropperHash;
private String baneGuildHash; private String baneGuildHash;
private String baneNationHash; private String baneNationHash;
private DateTime baneLiveTime; private LocalDateTime baneLiveTime;
private DateTime baneDropTime; private LocalDateTime baneDropTime;
private BaneRecord(Bane bane) { private BaneRecord(Bane bane) {
this.recordType = Enum.DataRecordType.BANE; this.recordType = mbEnums.DataRecordType.BANE;
this.eventType = RecordEventType.PENDING; this.eventType = RecordEventType.PENDING;
} }
@@ -51,7 +50,7 @@ public class BaneRecord extends DataRecord {
baneRecord = new BaneRecord(bane); baneRecord = new BaneRecord(bane);
baneRecord.eventType = eventType; baneRecord.eventType = eventType;
} else { } else {
baneRecord.recordType = Enum.DataRecordType.BANE; baneRecord.recordType = mbEnums.DataRecordType.BANE;
baneRecord.eventType = eventType; baneRecord.eventType = eventType;
} }
@@ -129,9 +128,9 @@ public class BaneRecord extends DataRecord {
return outStatement; return outStatement;
} }
public static DateTime getLastBaneDateTime(City city) { public static LocalDateTime getLastBaneDateTime(City city) {
DateTime outDateTime = null; LocalDateTime outDateTime = null;
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement statement = buildDateTimeQueryStatement(connection, city); PreparedStatement statement = buildDateTimeQueryStatement(connection, city);
@@ -139,7 +138,7 @@ public class BaneRecord extends DataRecord {
while (rs.next()) { while (rs.next()) {
outDateTime = new DateTime(rs.getTimestamp("endDatetime")); outDateTime = rs.getTimestamp("endDatetime").toLocalDateTime();
} }
@@ -160,7 +159,7 @@ public class BaneRecord extends DataRecord {
} }
public static void updateLiveDate(Bane bane, DateTime dateTime) { public static void updateLiveDate(Bane bane, LocalDateTime dateTime) {
if (bane == null) if (bane == null)
return; return;
@@ -175,13 +174,13 @@ public class BaneRecord extends DataRecord {
} }
} }
private static PreparedStatement buildUpdateLiveDateStatement(Connection connection, Bane bane, DateTime dateTime) throws SQLException { private static PreparedStatement buildUpdateLiveDateStatement(Connection connection, Bane bane, LocalDateTime dateTime) throws SQLException {
PreparedStatement outStatement = null; PreparedStatement outStatement = null;
String queryString = "UPDATE `warehouse_banehistory` SET `liveDatetime` = ?, `dirty` = 1 WHERE `city_id` = ? AND `resolution` = 'PENDING'"; String queryString = "UPDATE `warehouse_banehistory` SET `liveDatetime` = ?, `dirty` = 1 WHERE `city_id` = ? AND `resolution` = 'PENDING'";
outStatement = connection.prepareStatement(queryString); outStatement = connection.prepareStatement(queryString);
outStatement.setTimestamp(1, new java.sql.Timestamp(dateTime.getMillis())); outStatement.setTimestamp(1, Timestamp.valueOf(dateTime));
outStatement.setString(2, bane.getCity().getHash()); outStatement.setString(2, bane.getCity().getHash());
return outStatement; return outStatement;
@@ -366,12 +365,12 @@ public class BaneRecord extends DataRecord {
if (this.baneDropTime == null) if (this.baneDropTime == null)
outStatement.setNull(8, java.sql.Types.DATE); outStatement.setNull(8, java.sql.Types.DATE);
else else
outStatement.setTimestamp(8, new java.sql.Timestamp(this.baneDropTime.getMillis())); outStatement.setTimestamp(8, Timestamp.valueOf(this.baneDropTime));
if (this.baneLiveTime == null) if (this.baneLiveTime == null)
outStatement.setNull(9, java.sql.Types.DATE); outStatement.setNull(9, java.sql.Types.DATE);
else else
outStatement.setTimestamp(9, new java.sql.Timestamp(this.baneLiveTime.getMillis())); outStatement.setTimestamp(9, Timestamp.valueOf(this.baneLiveTime));
outStatement.setString(10, this.eventType.name()); outStatement.setString(10, this.eventType.name());
+5 -5
View File
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Guild; import engine.objects.Guild;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import engine.workthreads.WarehousePushThread; import engine.workthreads.WarehousePushThread;
@@ -33,7 +33,7 @@ public class CharacterRecord extends DataRecord {
private PlayerCharacter player; private PlayerCharacter player;
private CharacterRecord(PlayerCharacter player) { private CharacterRecord(PlayerCharacter player) {
this.recordType = Enum.DataRecordType.CHARACTER; this.recordType = mbEnums.DataRecordType.CHARACTER;
this.player = player; this.player = player;
} }
@@ -45,7 +45,7 @@ public class CharacterRecord extends DataRecord {
if (characterRecord == null) { if (characterRecord == null) {
characterRecord = new CharacterRecord(player); characterRecord = new CharacterRecord(player);
} else { } else {
characterRecord.recordType = Enum.DataRecordType.CHARACTER; characterRecord.recordType = mbEnums.DataRecordType.CHARACTER;
characterRecord.player = player; characterRecord.player = player;
} }
+10 -10
View File
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.City; import engine.objects.City;
import engine.workthreads.WarehousePushThread; import engine.workthreads.WarehousePushThread;
@@ -20,7 +20,7 @@ import java.util.concurrent.LinkedBlockingQueue;
public class CityRecord extends DataRecord { public class CityRecord extends DataRecord {
private static final LinkedBlockingQueue<CityRecord> recordPool = new LinkedBlockingQueue<>(); private static final LinkedBlockingQueue<CityRecord> recordPool = new LinkedBlockingQueue<>();
private Enum.RecordEventType eventType; private mbEnums.RecordEventType eventType;
private City city; private City city;
private String cityHash; private String cityHash;
private String cityGuildHash; private String cityGuildHash;
@@ -32,13 +32,13 @@ public class CityRecord extends DataRecord {
private java.time.LocalDateTime establishedDatetime; private java.time.LocalDateTime establishedDatetime;
private CityRecord(City city) { private CityRecord(City city) {
this.recordType = Enum.DataRecordType.CITY; this.recordType = mbEnums.DataRecordType.CITY;
this.city = city; this.city = city;
this.eventType = Enum.RecordEventType.CREATE; this.eventType = mbEnums.RecordEventType.CREATE;
} }
public static CityRecord borrow(City city, Enum.RecordEventType eventType) { public static CityRecord borrow(City city, mbEnums.RecordEventType eventType) {
CityRecord cityRecord; CityRecord cityRecord;
cityRecord = recordPool.poll(); cityRecord = recordPool.poll();
@@ -47,7 +47,7 @@ public class CityRecord extends DataRecord {
cityRecord = new CityRecord(city); cityRecord = new CityRecord(city);
cityRecord.eventType = eventType; cityRecord.eventType = eventType;
} else { } else {
cityRecord.recordType = Enum.DataRecordType.CITY; cityRecord.recordType = mbEnums.DataRecordType.CITY;
cityRecord.eventType = eventType; cityRecord.eventType = eventType;
cityRecord.city = city; cityRecord.city = city;
@@ -67,9 +67,9 @@ public class CityRecord extends DataRecord {
cityRecord.locX = cityRecord.city.getTOL().getLoc().x; cityRecord.locX = cityRecord.city.getTOL().getLoc().x;
cityRecord.locY = -cityRecord.city.getTOL().getLoc().z; // flip sign on 'y' coordinate cityRecord.locY = -cityRecord.city.getTOL().getLoc().z; // flip sign on 'y' coordinate
cityRecord.zoneHash = cityRecord.city.getParent().getHash(); cityRecord.zoneHash = cityRecord.city.getParent().hash;
if (cityRecord.eventType.equals(Enum.RecordEventType.CREATE)) if (cityRecord.eventType.equals(mbEnums.RecordEventType.CREATE))
cityRecord.establishedDatetime = cityRecord.city.established; cityRecord.establishedDatetime = cityRecord.city.established;
else else
cityRecord.establishedDatetime = java.time.LocalDateTime.now(); cityRecord.establishedDatetime = java.time.LocalDateTime.now();
+4 -4
View File
@@ -3,17 +3,17 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.archive; package engine.db.archive;
import engine.Enum; import engine.mbEnums;
class DataRecord { class DataRecord {
public Enum.DataRecordType recordType; public mbEnums.DataRecordType recordType;
DataRecord() { DataRecord() {
+3 -3
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.archive; package engine.db.archive;
@@ -22,7 +22,7 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import static engine.Enum.DataRecordType; import static engine.mbEnums.DataRecordType;
public class DataWarehouse implements Runnable { public class DataWarehouse implements Runnable {
+11 -10
View File
@@ -3,15 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.Enum.RecordEventType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.RecordEventType;
import engine.objects.Guild; import engine.objects.Guild;
import engine.workthreads.WarehousePushThread; import engine.workthreads.WarehousePushThread;
@@ -30,7 +30,7 @@ public class GuildRecord extends DataRecord {
public static HashMap<Integer, GuildRecord> GuildRecordCache = null; public static HashMap<Integer, GuildRecord> GuildRecordCache = null;
public String guildHash; public String guildHash;
public int guildID; public int guildID;
private Enum.RecordEventType eventType; private mbEnums.RecordEventType eventType;
private Guild guild; private Guild guild;
private String guildName; private String guildName;
private String charterName; private String charterName;
@@ -44,9 +44,9 @@ public class GuildRecord extends DataRecord {
private java.time.LocalDateTime eventDatetime; private java.time.LocalDateTime eventDatetime;
private GuildRecord(Guild guild) { private GuildRecord(Guild guild) {
this.recordType = Enum.DataRecordType.GUILD; this.recordType = mbEnums.DataRecordType.GUILD;
this.guild = guild; this.guild = guild;
this.eventType = Enum.RecordEventType.CREATE; this.eventType = mbEnums.RecordEventType.CREATE;
} }
@@ -71,7 +71,7 @@ public class GuildRecord extends DataRecord {
} }
public static GuildRecord borrow(Guild guild, Enum.RecordEventType eventType) { public static GuildRecord borrow(Guild guild, mbEnums.RecordEventType eventType) {
GuildRecord guildRecord; GuildRecord guildRecord;
//add //add
guildRecord = recordPool.poll(); guildRecord = recordPool.poll();
@@ -81,7 +81,7 @@ public class GuildRecord extends DataRecord {
guildRecord.eventType = eventType; guildRecord.eventType = eventType;
} else { } else {
guildRecord.guild = guild; guildRecord.guild = guild;
guildRecord.recordType = Enum.DataRecordType.GUILD; guildRecord.recordType = mbEnums.DataRecordType.GUILD;
guildRecord.eventType = eventType; guildRecord.eventType = eventType;
} }
@@ -89,7 +89,8 @@ public class GuildRecord extends DataRecord {
guildRecord.guildHash = guildRecord.guild.getHash(); guildRecord.guildHash = guildRecord.guild.getHash();
guildRecord.guildID = guildRecord.guild.getObjectUUID(); guildRecord.guildID = guildRecord.guild.getObjectUUID();
guildRecord.guildName = guildRecord.guild.getName(); guildRecord.guildName = guildRecord.guild.getName();
guildRecord.charterName = Enum.GuildType.getGuildTypeFromInt(guildRecord.guild.getCharter()).getCharterName(); mbEnums.GuildCharterType guildCharterType = guild.charter;
guildRecord.charterName = guildCharterType.name;
guildRecord.GLHash = DataWarehouse.hasher.encrypt(guildRecord.guild.getGuildLeaderUUID()); guildRecord.GLHash = DataWarehouse.hasher.encrypt(guildRecord.guild.getGuildLeaderUUID());
+10 -10
View File
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.AbstractCharacter; import engine.objects.AbstractCharacter;
import engine.objects.Mine; import engine.objects.Mine;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@@ -23,7 +23,7 @@ import java.util.concurrent.LinkedBlockingQueue;
public class MineRecord extends DataRecord { public class MineRecord extends DataRecord {
private static final LinkedBlockingQueue<MineRecord> recordPool = new LinkedBlockingQueue<>(); private static final LinkedBlockingQueue<MineRecord> recordPool = new LinkedBlockingQueue<>();
private Enum.RecordEventType eventType; private mbEnums.RecordEventType eventType;
private String zoneHash; private String zoneHash;
private String charHash; private String charHash;
private String mineGuildHash; private String mineGuildHash;
@@ -33,12 +33,12 @@ public class MineRecord extends DataRecord {
private float locY; private float locY;
private MineRecord() { private MineRecord() {
this.recordType = Enum.DataRecordType.MINE; this.recordType = mbEnums.DataRecordType.MINE;
this.eventType = Enum.RecordEventType.CAPTURE; this.eventType = mbEnums.RecordEventType.CAPTURE;
} }
public static MineRecord borrow(Mine mine, AbstractCharacter character, Enum.RecordEventType eventType) { public static MineRecord borrow(Mine mine, AbstractCharacter character, mbEnums.RecordEventType eventType) {
MineRecord mineRecord; MineRecord mineRecord;
mineRecord = recordPool.poll(); mineRecord = recordPool.poll();
@@ -48,13 +48,13 @@ public class MineRecord extends DataRecord {
mineRecord = new MineRecord(); mineRecord = new MineRecord();
mineRecord.eventType = eventType; mineRecord.eventType = eventType;
} else { } else {
mineRecord.recordType = Enum.DataRecordType.MINE; mineRecord.recordType = mbEnums.DataRecordType.MINE;
mineRecord.eventType = eventType; mineRecord.eventType = eventType;
} }
mineRecord.zoneHash = mine.getParentZone().getHash(); mineRecord.zoneHash = mine.getParentZone().hash;
if (character.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { if (character.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
player = (PlayerCharacter) character; player = (PlayerCharacter) character;
mineRecord.charHash = player.getHash(); mineRecord.charHash = player.getHash();
} else } else
+5 -5
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.archive; package engine.db.archive;
@@ -23,8 +23,8 @@ import java.time.LocalDateTime;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import static engine.Enum.DataRecordType; import static engine.mbEnums.DataRecordType;
import static engine.Enum.PvpHistoryType; import static engine.mbEnums.PvpHistoryType;
public class PvpRecord extends DataRecord { public class PvpRecord extends DataRecord {
@@ -281,7 +281,7 @@ public class PvpRecord extends DataRecord {
outStatement.setInt(8, this.victim.getLevel()); outStatement.setInt(8, this.victim.getLevel());
outStatement.setString(9, DataWarehouse.hasher.encrypt(zone.getObjectUUID())); outStatement.setString(9, DataWarehouse.hasher.encrypt(zone.getObjectUUID()));
outStatement.setString(10, zone.getName()); outStatement.setString(10, zone.zoneName);
outStatement.setFloat(11, this.location.getX()); outStatement.setFloat(11, this.location.getX());
outStatement.setFloat(12, -this.location.getZ()); // flip sign on 'y' coordinate outStatement.setFloat(12, -this.location.getZ()); // flip sign on 'y' coordinate
outStatement.setBoolean(13, this.pvpExp); outStatement.setBoolean(13, this.pvpExp);
+10 -10
View File
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Realm; import engine.objects.Realm;
import engine.workthreads.WarehousePushThread; import engine.workthreads.WarehousePushThread;
@@ -23,20 +23,20 @@ public class RealmRecord extends DataRecord {
private static final LinkedBlockingQueue<RealmRecord> recordPool = new LinkedBlockingQueue<>(); private static final LinkedBlockingQueue<RealmRecord> recordPool = new LinkedBlockingQueue<>();
private Realm realm; private Realm realm;
private Enum.RecordEventType eventType; private mbEnums.RecordEventType eventType;
private String cityHash; private String cityHash;
private String guildHash; private String guildHash;
private String charterType; private String charterType;
private LocalDateTime eventDateTime; private LocalDateTime eventDateTime;
private RealmRecord(Realm realm) { private RealmRecord(Realm realm) {
this.recordType = Enum.DataRecordType.REALM; this.recordType = mbEnums.DataRecordType.REALM;
this.realm = realm; this.realm = realm;
this.eventType = Enum.RecordEventType.CAPTURE; this.eventType = mbEnums.RecordEventType.CAPTURE;
} }
public static RealmRecord borrow(Realm realm, Enum.RecordEventType eventType) { public static RealmRecord borrow(Realm realm, mbEnums.RecordEventType eventType) {
RealmRecord realmRecord; RealmRecord realmRecord;
realmRecord = recordPool.poll(); realmRecord = recordPool.poll();
@@ -45,7 +45,7 @@ public class RealmRecord extends DataRecord {
realmRecord = new RealmRecord(realm); realmRecord = new RealmRecord(realm);
realmRecord.eventType = eventType; realmRecord.eventType = eventType;
} else { } else {
realmRecord.recordType = Enum.DataRecordType.REALM; realmRecord.recordType = mbEnums.DataRecordType.REALM;
realmRecord.eventType = eventType; realmRecord.eventType = eventType;
realmRecord.realm = realm; realmRecord.realm = realm;
@@ -53,9 +53,9 @@ public class RealmRecord extends DataRecord {
realmRecord.cityHash = realm.getRulingCity().getHash(); realmRecord.cityHash = realm.getRulingCity().getHash();
realmRecord.guildHash = realm.getRulingCity().getGuild().getHash(); realmRecord.guildHash = realm.getRulingCity().getGuild().getHash();
realmRecord.charterType = Enum.CharterType.getCharterTypeByID(realmRecord.realm.getCharterType()).name(); realmRecord.charterType = mbEnums.CharterType.getCharterTypeByID(realmRecord.realm.getCharterType()).name();
if (realmRecord.eventType.equals(Enum.RecordEventType.CAPTURE)) if (realmRecord.eventType.equals(mbEnums.RecordEventType.CAPTURE))
realmRecord.eventDateTime = realm.ruledSince; realmRecord.eventDateTime = realm.ruledSince;
else else
realmRecord.eventDateTime = LocalDateTime.now(); realmRecord.eventDateTime = LocalDateTime.now();
+10 -18
View File
@@ -3,18 +3,16 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.net.DispatchMessage; import engine.mbEnums;
import engine.net.client.msg.chat.ChatSystemMsg; import engine.mbEnums.GameObjectType;
import engine.objects.Account; import engine.objects.Account;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -29,7 +27,7 @@ public class dbAccountHandler extends dbHandlerBase {
public dbAccountHandler() { public dbAccountHandler() {
this.localClass = Account.class; this.localClass = Account.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public Account GET_ACCOUNT(int accountID) { public Account GET_ACCOUNT(int accountID) {
@@ -79,24 +77,18 @@ public class dbAccountHandler extends dbHandlerBase {
} }
} }
public void SET_TRASH(String machineID, String type) { public void SET_TRASH(String machineID) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement( PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO dyn_trash(`machineID`, `count`)"
"INSERT INTO dyn_trash(`machineID`, `count`, `type`)" + " VALUES (?, 1) ON DUPLICATE KEY UPDATE `count` = `count` + 1;")) {
+ " VALUES (?, 1, ?) ON DUPLICATE KEY UPDATE `count` = `count` + 1;")) {
preparedStatement.setString(1, machineID); preparedStatement.setString(1, machineID);
preparedStatement.setString(2, type);
preparedStatement.execute(); preparedStatement.execute();
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
} }
ChatSystemMsg chatMsg = new ChatSystemMsg(null, "Account: " + machineID + " has been kicked from game for cheating");
chatMsg.setMessageType(10);
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(chatMsg);
} }
public ArrayList<String> GET_TRASH_LIST() { public ArrayList<String> GET_TRASH_LIST() {
@@ -212,7 +204,7 @@ public class dbAccountHandler extends dbHandlerBase {
if (account != null) { if (account != null) {
account.runAfterLoad(); account.runAfterLoad();
if (ConfigManager.serverType.equals(Enum.ServerType.LOGINSERVER)) if (ConfigManager.serverType.equals(mbEnums.ServerType.LOGINSERVER))
Account.AccountsMap.put(uname, account.getObjectUUID()); Account.AccountsMap.put(uname, account.getObjectUUID());
} }
+13 -163
View File
@@ -3,20 +3,24 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager; import engine.objects.Bane;
import engine.math.Vector3fImmutable; import engine.objects.Building;
import engine.objects.*; import engine.objects.City;
import org.joda.time.DateTime; import engine.objects.PlayerCharacter;
import java.time.LocalDateTime;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.*; import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class dbBaneHandler extends dbHandlerBase { public class dbBaneHandler extends dbHandlerBase {
@@ -67,12 +71,12 @@ public class dbBaneHandler extends dbHandlerBase {
} }
public boolean SET_BANE_TIME(DateTime toSet, int cityUUID) { public boolean SET_BANE_TIME(LocalDateTime toSet, int cityUUID) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `liveDate`=? WHERE `cityUUID`=?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `liveDate`=? WHERE `cityUUID`=?")) {
preparedStatement.setTimestamp(1, new java.sql.Timestamp(toSet.getMillis())); preparedStatement.setTimestamp(1, java.sql.Timestamp.valueOf(toSet));
preparedStatement.setLong(2, cityUUID); preparedStatement.setLong(2, cityUUID);
preparedStatement.execute(); preparedStatement.execute();
@@ -85,139 +89,6 @@ public class dbBaneHandler extends dbHandlerBase {
return true; return true;
} }
public boolean SET_BANE_TIME_NEW(int hour, int cityUUID) {
hour += 12; // Adjust hour
try (Connection connection = DbManager.getConnection();
PreparedStatement getStatement = connection.prepareStatement("SELECT `placementDate`, `liveDate` FROM `dyn_banes` WHERE `cityUUID`=?");
PreparedStatement updateStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `liveDate`=?, `time_set`=? WHERE `cityUUID`=?")) {
// Retrieve placementDate and liveDate
getStatement.setInt(1, cityUUID);
try (ResultSet rs = getStatement.executeQuery()) {
if (rs.next()) {
DateTime placementDate = new DateTime(rs.getTimestamp("placementDate").getTime());
Timestamp liveDateTimestamp = rs.getTimestamp("liveDate");
// Explicitly check if liveDate is null
DateTime toSet;
if (liveDateTimestamp == null) {
// If liveDate is null, default to placementDate
toSet = placementDate;
} else {
// If liveDate is not null, use it
DateTime liveDate = new DateTime(liveDateTimestamp.getTime());
toSet = liveDate;
}
// Adjust the time
toSet = toSet.withHourOfDay(hour).withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0);
// Update liveDate and time_set flag
updateStatement.setTimestamp(1, new java.sql.Timestamp(toSet.getMillis()));
updateStatement.setInt(2, 1); // time_set flag
updateStatement.setInt(3, cityUUID);
updateStatement.execute();
return true;
}
}
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean SET_BANE_DAY_NEW(int dayOffset, int cityUUID) {
try (Connection connection = DbManager.getConnection();
PreparedStatement getStatement = connection.prepareStatement("SELECT `placementDate`, `liveDate` FROM `dyn_banes` WHERE `cityUUID`=?");
PreparedStatement updateStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `liveDate`=?, `day_set`=? WHERE `cityUUID`=?")) {
// Retrieve placementDate and liveDate
getStatement.setInt(1, cityUUID);
try (ResultSet rs = getStatement.executeQuery()) {
if (rs.next()) {
DateTime placementDate = new DateTime(rs.getTimestamp("placementDate").getTime());
Timestamp liveDateTimestamp = rs.getTimestamp("liveDate");
// Explicitly check if liveDate is null
DateTime liveDate;
if (liveDateTimestamp == null) {
// If liveDate is null, default to placementDate
liveDate = placementDate;
} else {
// If liveDate is not null, use it
liveDate = new DateTime(liveDateTimestamp.getTime());
}
// Calculate the new liveDate while preserving the time component
DateTime updatedDate = placementDate.plusDays(dayOffset)
.withHourOfDay(liveDate.getHourOfDay())
.withMinuteOfHour(liveDate.getMinuteOfHour())
.withSecondOfMinute(liveDate.getSecondOfMinute())
.withMillisOfSecond(liveDate.getMillisOfSecond());
// Update liveDate and day_set flag
updateStatement.setTimestamp(1, new java.sql.Timestamp(updatedDate.getMillis()));
updateStatement.setInt(2, 1); // day_set flag
updateStatement.setInt(3, cityUUID);
updateStatement.execute();
return true;
}
}
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean SET_BANE_CAP_NEW(int count, int cityUUID) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `cap_size`=? WHERE `cityUUID`=?")) {
preparedStatement.setInt(1, count);
preparedStatement.setLong(2, cityUUID);
preparedStatement.execute();
} catch (SQLException e) {
Logger.error(e);
return false;
}
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `cap_set`=? WHERE `cityUUID`=?")) {
preparedStatement.setInt(1, 1);
preparedStatement.setLong(2, cityUUID);
preparedStatement.execute();
} catch (SQLException e) {
Logger.error(e);
return false;
}
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `cap_size`=? WHERE `cityUUID`=?")) {
preparedStatement.setInt(1, count);
preparedStatement.setLong(2, cityUUID);
preparedStatement.execute();
} catch (SQLException e) {
Logger.error(e);
return false;
}
return true;
}
public boolean REMOVE_BANE(Bane bane) { public boolean REMOVE_BANE(Bane bane) {
if (bane == null) if (bane == null)
@@ -236,25 +107,4 @@ public class dbBaneHandler extends dbHandlerBase {
return true; return true;
} }
public DateTime getLiveDate(int cityUUID) {
try (Connection connection = DbManager.getConnection();
PreparedStatement statement = connection.prepareStatement("SELECT `liveDate` FROM `dyn_banes` WHERE `cityUUID`=?")) {
statement.setInt(1, cityUUID);
try (ResultSet rs = statement.executeQuery()) {
if (rs.next()) {
Timestamp liveDateTimestamp = rs.getTimestamp("liveDate");
if (liveDateTimestamp != null) {
return new DateTime(liveDateTimestamp.getTime());
}
}
}
} catch (SQLException e) {
Logger.error(e);
}
return null; // Return null if liveDate is not found or an error occurs
}
} }
@@ -3,15 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.objects.BaseClass; import engine.objects.BaseClass;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -25,7 +25,7 @@ public class dbBaseClassHandler extends dbHandlerBase {
public dbBaseClassHandler() { public dbBaseClassHandler() {
this.localClass = BaseClass.class; this.localClass = BaseClass.class;
this.localObjectType = Enum.GameObjectType.BaseClass; this.localObjectType = mbEnums.GameObjectType.BaseClass;
} }
public BaseClass GET_BASE_CLASS(final int id) { public BaseClass GET_BASE_CLASS(final int id) {
-51
View File
@@ -1,51 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.db.handlers;
import engine.gameManager.DbManager;
import engine.objects.Boon;
import org.pmw.tinylog.Logger;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
public class dbBoonHandler extends dbHandlerBase {
public dbBoonHandler() {
}
public ArrayList<Boon> GET_BOON_AMOUNTS_FOR_ITEMBASE(int itemBaseUUID) {
ArrayList<Boon> boons = new ArrayList<>();
Boon thisBoon;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_item_boons` WHERE `itemBaseID` = ?")) {
preparedStatement.setInt(1, itemBaseUUID);
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
thisBoon = new Boon(rs);
boons.add(thisBoon);
}
} catch (SQLException e) {
Logger.error(e);
}
return boons;
}
}
+57 -59
View File
@@ -3,20 +3,23 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum; import engine.gameManager.BuildingManager;
import engine.Enum.DbObjectType;
import engine.Enum.ProtectionState;
import engine.Enum.TaxType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.mbEnums.DbObjectType;
import engine.mbEnums.ProtectionState;
import engine.mbEnums.TaxType;
import engine.objects.*; import engine.objects.*;
import org.joda.time.DateTime; import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
@@ -27,18 +30,19 @@ import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
public class dbBuildingHandler extends dbHandlerBase { public class dbBuildingHandler extends dbHandlerBase {
public dbBuildingHandler() { public dbBuildingHandler() {
this.localClass = Building.class; this.localClass = Building.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public Building CREATE_BUILDING(int parentZoneID, int OwnerUUID, String name, int meshUUID, public Building CREATE_BUILDING(int parentZoneID, int OwnerUUID, String name, int meshUUID,
Vector3fImmutable location, float meshScale, int currentHP, Vector3fImmutable location, float meshScale, int currentHP,
ProtectionState protectionState, int currentGold, int rank, ProtectionState protectionState, int currentGold, int rank,
DateTime upgradeDate, int blueprintUUID, float w, float rotY) { Instant upgradeDate, int blueprintUUID, float w, float rotY) {
Building building = null; Building building = null;
@@ -59,7 +63,7 @@ public class dbBuildingHandler extends dbHandlerBase {
preparedStatement.setInt(12, rank); preparedStatement.setInt(12, rank);
if (upgradeDate != null) if (upgradeDate != null)
preparedStatement.setTimestamp(13, new java.sql.Timestamp(upgradeDate.getMillis())); preparedStatement.setTimestamp(13, new java.sql.Timestamp(upgradeDate.toEpochMilli()));
else else
preparedStatement.setNull(13, java.sql.Types.DATE); preparedStatement.setNull(13, java.sql.Types.DATE);
@@ -88,14 +92,12 @@ public class dbBuildingHandler extends dbHandlerBase {
return removeFromBuildings(b); return removeFromBuildings(b);
} }
public ArrayList<Building> GET_ALL_BUILDINGS_FOR_ZONE(Zone zone) { public ArrayList<Building> GET_ALL_BUILDINGS() {
ArrayList<Building> buildings = new ArrayList<>(); ArrayList<Building> buildings = new ArrayList<>();
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_building`.*, `object`.`parent` FROM `object` INNER JOIN `obj_building` ON `obj_building`.`UID` = `object`.`UID` WHERE `object`.`parent` = ?;")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_building`.*, `object`.`parent` FROM `object` INNER JOIN `obj_building` ON `obj_building`.`UID` = `object`.`UID` ORDER BY `object`.`UID` ASC;")) {
preparedStatement.setLong(1, zone.getObjectUUID());
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
buildings = getObjectsFromRs(rs, 1000); buildings = getObjectsFromRs(rs, 1000);
@@ -112,7 +114,7 @@ public class dbBuildingHandler extends dbHandlerBase {
if (uuid == 0) if (uuid == 0)
return null; return null;
Building building = (Building) DbManager.getFromCache(Enum.GameObjectType.Building, uuid); Building building = (Building) DbManager.getFromCache(mbEnums.GameObjectType.Building, uuid);
if (building != null) if (building != null)
return building; return building;
@@ -425,26 +427,28 @@ public class dbBuildingHandler extends dbHandlerBase {
return false; return false;
} }
public void LOAD_ALL_FRIENDS_FOR_BUILDING(Building building) { public void LOAD_BUILDING_FRIENDS() {
if (building == null)
return;
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_building_friends` WHERE `buildingUID` = ?")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_building_friends`")) {
preparedStatement.setInt(1, building.getObjectUUID());
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) { while (rs.next()) {
BuildingFriends friend = new BuildingFriends(rs); BuildingFriends friend = new BuildingFriends(rs);
switch (friend.getFriendType()) {
// Create map if it does not yet exist
if (!BuildingManager._buildingFriends.containsKey(friend.buildingUID))
BuildingManager._buildingFriends.put(friend.buildingUID, new ConcurrentHashMap<>());
switch (friend.friendType) {
case 7: case 7:
building.getFriends().put(friend.getPlayerUID(), friend); BuildingManager._buildingFriends.get(friend.buildingUID).put(friend.playerUID, friend);
break; break;
case 8: case 8:
case 9: case 9:
building.getFriends().put(friend.getGuildUID(), friend); BuildingManager._buildingFriends.get(friend.buildingUID).put(friend.guildUID, friend);
break; break;
} }
} }
@@ -455,26 +459,29 @@ public class dbBuildingHandler extends dbHandlerBase {
} }
public void LOAD_ALL_CONDEMNED_FOR_BUILDING(Building building) { public void LOAD_BUILDING_CONDEMNED() {
if (building == null)
return;
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_building_condemned` WHERE `buildingUID` = ?")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_building_condemned`")) {
preparedStatement.setInt(1, building.getObjectUUID());
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) { while (rs.next()) {
Condemned condemned = new Condemned(rs); Condemned condemned = new Condemned(rs);
switch (condemned.getFriendType()) {
// Create map if it does not yet exist
if (!BuildingManager._buildingCondemned.containsKey(condemned.buildingUUID))
BuildingManager._buildingCondemned.put(condemned.buildingUUID, new ConcurrentHashMap<>());
switch (condemned.friendType) {
case 2: case 2:
building.getCondemned().put(condemned.getPlayerUID(), condemned); BuildingManager._buildingCondemned.get(condemned.buildingUUID).put(condemned.playerUID, condemned);
break; break;
case 4: case 4:
case 5: case 5:
building.getCondemned().put(condemned.getGuildUID(), condemned); BuildingManager._buildingCondemned.get(condemned.buildingUUID).put(condemned.guildUID, condemned);
break; break;
} }
} }
@@ -484,35 +491,27 @@ public class dbBuildingHandler extends dbHandlerBase {
} }
} }
public ArrayList<Vector3fImmutable> LOAD_PATROL_POINTS(Building building) { public void LOAD_BARRACKS_PATROL_POINTS() {
if (building == null)
return null;
ArrayList<Vector3fImmutable> patrolPoints = new ArrayList<>();
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_building_patrol_points` WHERE `buildingUID` = ?")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_building_patrol_points`")) {
preparedStatement.setInt(1, building.getObjectUUID());
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) { while (rs.next()) {
float x1 = rs.getFloat("patrolX");
float y1 = rs.getFloat("patrolY"); int buildingUUID = rs.getInt("buildingUID");
float z1 = rs.getFloat("patrolZ");
Vector3fImmutable patrolPoint = new Vector3fImmutable(x1, y1, z1); if (!BuildingManager._buildingPatrolPoints.containsKey(buildingUUID))
patrolPoints.add(patrolPoint); BuildingManager._buildingPatrolPoints.put(buildingUUID, new ArrayList<>());
Vector3fImmutable patrolPoint = new Vector3fImmutable(rs.getFloat("patrolX"), rs.getFloat("patrolY"), rs.getFloat("patrolZ"));
BuildingManager._buildingPatrolPoints.get(buildingUUID).add(patrolPoint);
} }
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
} }
return patrolPoints;
} }
public boolean ADD_TO_CONDEMNLIST(final long parentUID, final long playerUID, final long guildID, final int friendType) { public boolean ADD_TO_CONDEMNLIST(final long parentUID, final long playerUID, final long guildID, final int friendType) {
@@ -722,10 +721,10 @@ public class dbBuildingHandler extends dbHandlerBase {
+ "WHERE`buildingUID` = ? AND `playerUID` = ? AND `guildUID` = ? AND `friendType` = ?")) { + "WHERE`buildingUID` = ? AND `playerUID` = ? AND `guildUID` = ? AND `friendType` = ?")) {
preparedStatement.setBoolean(1, active); preparedStatement.setBoolean(1, active);
preparedStatement.setInt(2, condemn.getParent()); preparedStatement.setInt(2, condemn.buildingUUID);
preparedStatement.setInt(3, condemn.getPlayerUID()); preparedStatement.setInt(3, condemn.playerUID);
preparedStatement.setInt(4, condemn.getGuildUID()); preparedStatement.setInt(4, condemn.guildUID);
preparedStatement.setInt(5, condemn.getFriendType()); preparedStatement.setInt(5, condemn.friendType);
return (preparedStatement.executeUpdate() > 0); return (preparedStatement.executeUpdate() > 0);
@@ -752,7 +751,7 @@ public class dbBuildingHandler extends dbHandlerBase {
return false; return false;
} }
public boolean updateBuildingUpgradeTime(LocalDateTime upgradeDateTime, Building toUpgrade, int costToUpgrade) { public boolean updateBuildingUpgradeTime(Instant upgradeDateTime, Building toUpgrade, int costToUpgrade) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_building SET upgradeDate=?, currentGold=? " PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_building SET upgradeDate=?, currentGold=? "
@@ -761,8 +760,7 @@ public class dbBuildingHandler extends dbHandlerBase {
if (upgradeDateTime == null) if (upgradeDateTime == null)
preparedStatement.setNull(1, java.sql.Types.DATE); preparedStatement.setNull(1, java.sql.Types.DATE);
else else
preparedStatement.setTimestamp(1, new java.sql.Timestamp(upgradeDateTime.atZone(ZoneId.systemDefault()) preparedStatement.setTimestamp(1, new java.sql.Timestamp(upgradeDateTime.toEpochMilli()));
.toInstant().toEpochMilli()));
preparedStatement.setInt(2, toUpgrade.getStrongboxValue() - costToUpgrade); preparedStatement.setInt(2, toUpgrade.getStrongboxValue() - costToUpgrade);
preparedStatement.setInt(3, toUpgrade.getObjectUUID()); preparedStatement.setInt(3, toUpgrade.getObjectUUID());
@@ -841,7 +839,7 @@ public class dbBuildingHandler extends dbHandlerBase {
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_building SET taxDate=? " PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_building SET taxDate=? "
+ "WHERE UID = ?")) { + "WHERE UID = ?")) {
preparedStatement.setTimestamp(1, new java.sql.Timestamp(DateTime.now().plusDays(7).getMillis())); preparedStatement.setTimestamp(1, new java.sql.Timestamp(Instant.now().plus(7, java.time.temporal.ChronoUnit.DAYS).toEpochMilli()));
preparedStatement.setInt(2, building.getObjectUUID()); preparedStatement.setInt(2, building.getObjectUUID());
return (preparedStatement.executeUpdate() > 0); return (preparedStatement.executeUpdate() > 0);
@@ -3,13 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.BuildingLocation; import engine.objects.BuildingLocation;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -23,7 +24,7 @@ public class dbBuildingLocationHandler extends dbHandlerBase {
public dbBuildingLocationHandler() { public dbBuildingLocationHandler() {
this.localClass = BuildingLocation.class; this.localClass = BuildingLocation.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<BuildingLocation> LOAD_BUILDING_LOCATIONS() { public ArrayList<BuildingLocation> LOAD_BUILDING_LOCATIONS() {
@@ -3,13 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Account; import engine.objects.Account;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import engine.session.CSSession; import engine.session.CSSession;
@@ -26,7 +27,7 @@ public class dbCSSessionHandler extends dbHandlerBase {
public dbCSSessionHandler() { public dbCSSessionHandler() {
this.localClass = CSSession.class; this.localClass = CSSession.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public boolean ADD_CSSESSION(String secKey, Account acc, InetAddress inet, String machineID) { public boolean ADD_CSSESSION(String secKey, Account acc, InetAddress inet, String machineID) {
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.CharacterPower; import engine.objects.CharacterPower;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
@@ -23,7 +23,7 @@ public class dbCharacterPowerHandler extends dbHandlerBase {
public dbCharacterPowerHandler() { public dbCharacterPowerHandler() {
this.localClass = CharacterPower.class; this.localClass = CharacterPower.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public CharacterPower ADD_CHARACTER_POWER(CharacterPower toAdd) { public CharacterPower ADD_CHARACTER_POWER(CharacterPower toAdd) {
@@ -74,7 +74,7 @@ public class dbCharacterPowerHandler extends dbHandlerBase {
public CharacterPower GET_CHARACTER_POWER(int objectUUID) { public CharacterPower GET_CHARACTER_POWER(int objectUUID) {
CharacterPower characterPower = (CharacterPower) DbManager.getFromCache(Enum.GameObjectType.CharacterPower, objectUUID); CharacterPower characterPower = (CharacterPower) DbManager.getFromCache(mbEnums.GameObjectType.CharacterPower, objectUUID);
if (characterPower != null) if (characterPower != null)
return characterPower; return characterPower;
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.CharacterRune; import engine.objects.CharacterRune;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -21,7 +21,7 @@ public class dbCharacterRuneHandler extends dbHandlerBase {
public dbCharacterRuneHandler() { public dbCharacterRuneHandler() {
this.localClass = CharacterRune.class; this.localClass = CharacterRune.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public CharacterRune ADD_CHARACTER_RUNE(final CharacterRune toAdd) { public CharacterRune ADD_CHARACTER_RUNE(final CharacterRune toAdd) {
@@ -49,7 +49,7 @@ public class dbCharacterRuneHandler extends dbHandlerBase {
public CharacterRune GET_CHARACTER_RUNE(int runeID) { public CharacterRune GET_CHARACTER_RUNE(int runeID) {
CharacterRune characterRune = (CharacterRune) DbManager.getFromCache(Enum.GameObjectType.CharacterRune, runeID); CharacterRune characterRune = (CharacterRune) DbManager.getFromCache(mbEnums.GameObjectType.CharacterRune, runeID);
if (characterRune != null) if (characterRune != null)
return characterRune; return characterRune;
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.AbstractCharacter; import engine.objects.AbstractCharacter;
import engine.objects.CharacterSkill; import engine.objects.CharacterSkill;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@@ -24,7 +24,7 @@ public class dbCharacterSkillHandler extends dbHandlerBase {
public dbCharacterSkillHandler() { public dbCharacterSkillHandler() {
this.localClass = CharacterSkill.class; this.localClass = CharacterSkill.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public CharacterSkill ADD_SKILL(CharacterSkill toAdd) { public CharacterSkill ADD_SKILL(CharacterSkill toAdd) {
@@ -72,7 +72,7 @@ public class dbCharacterSkillHandler extends dbHandlerBase {
public CharacterSkill GET_SKILL(final int objectUUID) { public CharacterSkill GET_SKILL(final int objectUUID) {
CharacterSkill characterSkill = (CharacterSkill) DbManager.getFromCache(Enum.GameObjectType.CharacterSkill, objectUUID); CharacterSkill characterSkill = (CharacterSkill) DbManager.getFromCache(mbEnums.GameObjectType.CharacterSkill, objectUUID);
if (characterSkill != null) if (characterSkill != null)
return characterSkill; return characterSkill;
@@ -95,7 +95,7 @@ public class dbCharacterSkillHandler extends dbHandlerBase {
ConcurrentHashMap<String, CharacterSkill> characterSkills = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); ConcurrentHashMap<String, CharacterSkill> characterSkills = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
if (ac == null || (!(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))) if (ac == null || (!(ac.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))))
return characterSkills; return characterSkills;
PlayerCharacter playerCharacter = (PlayerCharacter) ac; PlayerCharacter playerCharacter = (PlayerCharacter) ac;
+24 -30
View File
@@ -3,15 +3,18 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.*; import engine.mbEnums;
import engine.objects.AbstractGameObject;
import engine.objects.Building;
import engine.objects.City;
import engine.objects.Zone;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.*; import java.sql.*;
@@ -22,7 +25,7 @@ public class dbCityHandler extends dbHandlerBase {
public dbCityHandler() { public dbCityHandler() {
this.localClass = City.class; this.localClass = City.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static void addObject(ArrayList<AbstractGameObject> list, ResultSet rs) throws SQLException { public static void addObject(ArrayList<AbstractGameObject> list, ResultSet rs) throws SQLException {
@@ -31,40 +34,42 @@ public class dbCityHandler extends dbHandlerBase {
case "zone": case "zone":
Zone zone = new Zone(rs); Zone zone = new Zone(rs);
DbManager.addToCache(zone); DbManager.addToCache(zone);
zone.runAfterLoad();
list.add(zone); list.add(zone);
break; break;
case "building": case "building":
Building building = new Building(rs); Building building = new Building(rs);
DbManager.addToCache(building); DbManager.addToCache(building);
building.runAfterLoad();
list.add(building); list.add(building);
break; break;
case "city": case "city":
City city = new City(rs); City city = new City(rs);
DbManager.addToCache(city); DbManager.addToCache(city);
city.runAfterLoad();
list.add(city); list.add(city);
break; break;
} }
} }
public ArrayList<AbstractGameObject> CREATE_CITY(int ownerID, int parentZoneID, int realmID, float xCoord, float yCoord, float zCoord, float rotation, float W, String name, LocalDateTime established) { public ArrayList<AbstractGameObject> CREATE_CITY(int ownerID, int parentZoneID, float xCoord, float yCoord, float zCoord, float rotation, float W, String name, LocalDateTime established) {
LocalDateTime upgradeTime = LocalDateTime.now().plusHours(2); LocalDateTime upgradeTime = LocalDateTime.now().plusHours(2);
ArrayList<AbstractGameObject> objectList = new ArrayList<>(); ArrayList<AbstractGameObject> objectList = new ArrayList<>();
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("CALL `city_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?,?,?)")) { PreparedStatement preparedStatement = connection.prepareStatement("CALL `city_CREATE`(?, ?, ?, ?, ?, ?, ?, ?,?,?)")) {
preparedStatement.setLong(1, ownerID); //objectUUID of owning player preparedStatement.setLong(1, ownerID); //objectUUID of owning player
preparedStatement.setLong(2, parentZoneID); //objectUUID of parent (continent) zone preparedStatement.setLong(2, parentZoneID); //objectUUID of parent (continent) zone
preparedStatement.setLong(3, realmID); //objectUUID of realm city belongs in preparedStatement.setFloat(3, xCoord); //xOffset from parentZone center
preparedStatement.setFloat(4, xCoord); //xOffset from parentZone center preparedStatement.setFloat(4, yCoord); //yOffset from parentZone center
preparedStatement.setFloat(5, yCoord); //yOffset from parentZone center preparedStatement.setFloat(5, zCoord); //zOffset from parentZone center
preparedStatement.setFloat(6, zCoord); //zOffset from parentZone center preparedStatement.setString(6, name); //city name
preparedStatement.setString(7, name); //city name preparedStatement.setTimestamp(7, Timestamp.valueOf(established));
preparedStatement.setTimestamp(8, Timestamp.valueOf(established)); preparedStatement.setFloat(8, rotation);
preparedStatement.setFloat(9, rotation); preparedStatement.setFloat(9, W);
preparedStatement.setFloat(10, W); preparedStatement.setTimestamp(10, Timestamp.valueOf(upgradeTime));
preparedStatement.setTimestamp(11, Timestamp.valueOf(upgradeTime));
boolean work = preparedStatement.execute(); boolean work = preparedStatement.execute();
@@ -92,24 +97,13 @@ public class dbCityHandler extends dbHandlerBase {
return objectList; return objectList;
} }
public Integer GET_CAPITAL_CITY_COUNT() {
int cityCount = 0; public ArrayList<City> GET_ALL_CITIES() {
for(Realm realm : Realm._realms.values()){
if(realm.isRuled())
cityCount ++;
}
return cityCount;
}
public ArrayList<City> GET_CITIES_BY_ZONE(final int objectUUID) {
ArrayList<City> cityList = new ArrayList<>(); ArrayList<City> cityList = new ArrayList<>();
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_city`.*, `object`.`parent` FROM `obj_city` INNER JOIN `object` ON `object`.`UID` = `obj_city`.`UID` WHERE `object`.`parent`=?;")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_city`.*, `object`.`parent` FROM `obj_city` INNER JOIN `object` ON `object`.`UID` = `obj_city`.`UID` ORDER BY `object`.`UID` ASC;")) {
preparedStatement.setLong(1, objectUUID);
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
cityList = getObjectsFromRs(rs, 100); cityList = getObjectsFromRs(rs, 100);
@@ -123,7 +117,7 @@ public class dbCityHandler extends dbHandlerBase {
public City GET_CITY(final int cityId) { public City GET_CITY(final int cityId) {
City city = (City) DbManager.getFromCache(Enum.GameObjectType.City, cityId); City city = (City) DbManager.getFromCache(mbEnums.GameObjectType.City, cityId);
if (city != null) if (city != null)
return city; return city;
+16 -59
View File
@@ -3,17 +3,17 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.ItemManager;
import engine.mbEnums;
import engine.objects.Contract; import engine.objects.Contract;
import engine.objects.ItemBase; import engine.objects.Item;
import engine.objects.MobEquipment;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
@@ -25,12 +25,12 @@ public class dbContractHandler extends dbHandlerBase {
public dbContractHandler() { public dbContractHandler() {
this.localClass = Contract.class; this.localClass = Contract.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public Contract GET_CONTRACT(final int objectUUID) { public Contract GET_CONTRACT(final int objectUUID) {
Contract contract = (Contract) DbManager.getFromCache(Enum.GameObjectType.Contract, objectUUID); Contract contract = (Contract) DbManager.getFromCache(mbEnums.GameObjectType.Contract, objectUUID);
if (contract != null) if (contract != null)
return contract; return contract;
@@ -63,33 +63,12 @@ public class dbContractHandler extends dbHandlerBase {
while (rs.next()) { while (rs.next()) {
//handle item base int templateID = rs.getInt("templateID");
int itemBaseID = rs.getInt("itembaseID");
ItemBase ib = ItemBase.getItemBase(itemBaseID); Item item = new Item(templateID);
item.objectUUID = ItemManager.lastNegativeID.decrementAndGet();
contract.getSellInventory().add(item);
if (ib != null) {
MobEquipment me = new MobEquipment(ib, 0, 0);
contract.getSellInventory().add(me);
//handle magic effects
String prefix = rs.getString("prefix");
int pRank = rs.getInt("pRank");
String suffix = rs.getString("suffix");
int sRank = rs.getInt("sRank");
if (prefix != null) {
me.setPrefix(prefix, pRank);
me.setIsID(true);
}
if (suffix != null) {
me.setSuffix(suffix, sRank);
me.setIsID(true);
}
}
} }
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
@@ -98,7 +77,6 @@ public class dbContractHandler extends dbHandlerBase {
public void LOAD_SELL_LIST_FOR_CONTRACT(final Contract contract) { public void LOAD_SELL_LIST_FOR_CONTRACT(final Contract contract) {
if(!contract.getName().contains("Sage")) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_contract_selltype` WHERE `contractID` = ?;")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_contract_selltype` WHERE `contractID` = ?;")) {
@@ -126,35 +104,14 @@ public class dbContractHandler extends dbHandlerBase {
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
} }
}else{
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_contract_selltype`;")) {
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
int value = rs.getInt("value");
if(!contract.getBuySkillToken().contains(value))
contract.getBuySkillToken().add(value);
if(!contract.getBuyItemType().contains(value))
contract.getBuyItemType().add(value);
if(!contract.getBuyUnknownToken().contains(value))
contract.getBuyUnknownToken().add(value);
}
} catch (SQLException e) {
Logger.error(e);
}
}
} }
public boolean updateAllowedBuildings(final Contract con, final long slotbitvalue) { public boolean updateAllowedBuildings(final Contract con) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `static_npc_contract` SET `allowedBuildingTypeID`=? WHERE `contractID`=?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `static_npc_contract` SET `slotInBuildings`=? WHERE `contractID`=?")) {
preparedStatement.setLong(1, slotbitvalue); preparedStatement.setString(1, mbEnums.asString(con.allowedBuildings));
preparedStatement.setInt(2, con.getContractID()); preparedStatement.setInt(2, con.getContractID());
return (preparedStatement.executeUpdate() > 0); return (preparedStatement.executeUpdate() > 0);
@@ -169,7 +126,7 @@ public class dbContractHandler extends dbHandlerBase {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `static_npc_contract` SET `contractID`=?, `name`=?, " PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `static_npc_contract` SET `contractID`=?, `name`=?, "
+ "`mobbaseID`=?, `classID`=?, vendorDialog=?, iconID=?, allowedBuildingTypeID=? WHERE `ID`=?")) { + "`mobbaseID`=?, `classID`=?, vendorDialog=?, iconID=?, slotInBuildings=? WHERE `ID`=?")) {
preparedStatement.setInt(1, con.getContractID()); preparedStatement.setInt(1, con.getContractID());
preparedStatement.setString(2, con.getName()); preparedStatement.setString(2, con.getName());
@@ -178,7 +135,7 @@ public class dbContractHandler extends dbHandlerBase {
preparedStatement.setInt(5, (con.getVendorDialog() != null) ? con.getVendorDialog().getObjectUUID() : 0); preparedStatement.setInt(5, (con.getVendorDialog() != null) ? con.getVendorDialog().getObjectUUID() : 0);
preparedStatement.setInt(6, con.getIconID()); preparedStatement.setInt(6, con.getIconID());
preparedStatement.setInt(8, con.getObjectUUID()); preparedStatement.setInt(8, con.getObjectUUID());
preparedStatement.setLong(7, con.getAllowedBuildings().toLong()); preparedStatement.setString(7, mbEnums.asString(con.allowedBuildings));
return (preparedStatement.executeUpdate() > 0); return (preparedStatement.executeUpdate() > 0);
@@ -3,15 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.mbEnums;
import engine.powers.EffectsBase; import engine.powers.EffectsBase;
import engine.powers.effectmodifiers.*; import engine.powers.effectmodifiers.*;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -63,7 +63,7 @@ public class dbEffectsBaseHandler extends dbHandlerBase {
IDString = rs.getString("IDString"); IDString = rs.getString("IDString");
EffectsBase effectBase = PowersManager.getEffectByIDString(IDString); EffectsBase effectBase = PowersManager.getEffectByIDString(IDString);
Enum.ModType modifier = Enum.ModType.GetModType(rs.getString("modType")); mbEnums.ModType modifier = mbEnums.ModType.GetModType(rs.getString("modType"));
//combine item prefix and suffix effect modifiers //combine item prefix and suffix effect modifiers
@@ -86,7 +86,7 @@ public class dbEffectsBaseHandler extends dbHandlerBase {
} }
private static AbstractEffectModifier getCombinedModifiers(AbstractEffectModifier abstractEffectModifier, ResultSet rs, EffectsBase effectBase, Enum.ModType modifier) throws SQLException { private static AbstractEffectModifier getCombinedModifiers(AbstractEffectModifier abstractEffectModifier, ResultSet rs, EffectsBase effectBase, mbEnums.ModType modifier) throws SQLException {
switch (modifier) { switch (modifier) {
case AdjustAboveDmgCap: case AdjustAboveDmgCap:
abstractEffectModifier = new AdjustAboveDmgCapEffectModifier(rs); abstractEffectModifier = new AdjustAboveDmgCapEffectModifier(rs);
@@ -3,45 +3,56 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PowersManager;
import engine.mbEnums;
import engine.objects.EffectsResourceCosts; import engine.objects.EffectsResourceCosts;
import org.json.JSONObject;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.HashMap;
public class dbEffectsResourceCostHandler extends dbHandlerBase { public class dbEffectsResourceCostHandler extends dbHandlerBase {
public dbEffectsResourceCostHandler() { public dbEffectsResourceCostHandler() {
this.localClass = EffectsResourceCosts.class; this.localClass = EffectsResourceCosts.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<EffectsResourceCosts> GET_ALL_EFFECT_RESOURCES(String idString) { public void LOAD_ALL_COSTMAPS() {
ArrayList<EffectsResourceCosts> effectsResourceCosts = new ArrayList<>();
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_power_effectcost` WHERE `IDString` = ?")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_effect_costmaps`")) {
preparedStatement.setString(1, idString);
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
effectsResourceCosts = getObjectsFromRs(rs, 1000);
while (rs.next()) {
String effectID = rs.getString("effectID");
String costString = rs.getString("costmap");
JSONObject costJSON = new JSONObject(costString);
HashMap<mbEnums.ResourceType, Integer> costmap = new HashMap<>();
for (String key : costJSON.keySet()) {
int value = costJSON.getInt(key);
costmap.put(mbEnums.ResourceType.valueOf(key), value);
}
PowersManager._effect_costMaps.put(effectID, costmap);
}
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
} }
}
return effectsResourceCosts;
}
} }
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
+11 -31
View File
@@ -3,18 +3,18 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.GuildHistoryType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.GuildHistoryType;
import engine.objects.*; import engine.objects.*;
import engine.server.world.WorldServer; import engine.server.world.WorldServer;
import org.joda.time.DateTime; import java.time.Instant;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.*; import java.sql.*;
@@ -24,7 +24,7 @@ public class dbGuildHandler extends dbHandlerBase {
public dbGuildHandler() { public dbGuildHandler() {
this.localClass = Guild.class; this.localClass = Guild.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static ArrayList<PlayerCharacter> GET_GUILD_BANISHED(final int id) { public static ArrayList<PlayerCharacter> GET_GUILD_BANISHED(final int id) {
@@ -125,7 +125,7 @@ public class dbGuildHandler extends dbHandlerBase {
return false; return false;
} }
public boolean ADD_TO_GUILDHISTORY(int target, PlayerCharacter playerCharacter, DateTime historyDate, GuildHistoryType historyType) { public boolean ADD_TO_GUILDHISTORY(int target, PlayerCharacter playerCharacter, Instant historyDate, GuildHistoryType historyType) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_character_guildhistory` (`GuildID`, `CharacterID`, `historyDate`, `historyType`) VALUES (?,?,?,?)")) { PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_character_guildhistory` (`GuildID`, `CharacterID`, `historyDate`, `historyType`) VALUES (?,?,?,?)")) {
@@ -136,7 +136,7 @@ public class dbGuildHandler extends dbHandlerBase {
if (historyDate == null) if (historyDate == null)
preparedStatement.setNull(3, java.sql.Types.DATE); preparedStatement.setNull(3, java.sql.Types.DATE);
else else
preparedStatement.setTimestamp(3, new Timestamp(historyDate.getMillis())); preparedStatement.setTimestamp(3, java.sql.Timestamp.from(historyDate));
preparedStatement.setString(4, historyType.name()); preparedStatement.setString(4, historyType.name());
@@ -276,7 +276,7 @@ public class dbGuildHandler extends dbHandlerBase {
public Guild GET_GUILD(int id) { public Guild GET_GUILD(int id) {
Guild guild = (Guild) DbManager.getFromCache(Enum.GameObjectType.Guild, id); Guild guild = (Guild) DbManager.getFromCache(mbEnums.GameObjectType.Guild, id);
if (guild != null) if (guild != null)
return guild; return guild;
@@ -427,7 +427,7 @@ public class dbGuildHandler extends dbHandlerBase {
preparedStatement.setInt(6, guildTag.symbolColor); preparedStatement.setInt(6, guildTag.symbolColor);
preparedStatement.setInt(7, guildTag.backgroundDesign); preparedStatement.setInt(7, guildTag.backgroundDesign);
preparedStatement.setInt(8, guildTag.symbol); preparedStatement.setInt(8, guildTag.symbol);
preparedStatement.setInt(9, g.getCharter()); preparedStatement.setInt(9, g.charter.templateID);
preparedStatement.setString(10, g.getLeadershipType()); preparedStatement.setString(10, g.getLeadershipType());
preparedStatement.setString(11, g.getMotto()); preparedStatement.setString(11, g.getMotto());
@@ -573,7 +573,7 @@ public class dbGuildHandler extends dbHandlerBase {
preparedStatement.setInt(4, g.getGuildTag().symbolColor); preparedStatement.setInt(4, g.getGuildTag().symbolColor);
preparedStatement.setInt(5, g.getGuildTag().backgroundDesign); preparedStatement.setInt(5, g.getGuildTag().backgroundDesign);
preparedStatement.setInt(6, g.getGuildTag().symbol); preparedStatement.setInt(6, g.getGuildTag().symbol);
preparedStatement.setInt(7, g.getCharter()); preparedStatement.setInt(7, g.charter.templateID);
preparedStatement.setString(8, g.getMOTD()); preparedStatement.setString(8, g.getMOTD());
preparedStatement.setString(9, g.getICMOTD()); preparedStatement.setString(9, g.getICMOTD());
preparedStatement.setString(10, ""); preparedStatement.setString(10, "");
@@ -695,24 +695,4 @@ public class dbGuildHandler extends dbHandlerBase {
} }
} }
//TODO uncomment this when finished with guild history warehouse integration
// public HashMap<Integer, GuildRecord> GET_WAREHOUSE_GUILD_HISTORY(){
//
// HashMap<Integer, GuildRecord> tempMap = new HashMap<>();
// prepareCallable("SELECT * FROM `warehouse_guildhistory` WHERE `eventType` = 'CREATE'");
// try {
// ResultSet rs = executeQuery();
//
// while (rs.next()) {
// GuildRecord guildRecord = new GuildRecord(rs);
// tempMap.put(guildRecord.guildID, guildRecord);
// }
// }catch (Exception e){
// Logger.error(e);
// }
// return tempMap;
//
// }
} }
+9 -21
View File
@@ -3,16 +3,16 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -32,6 +32,7 @@ public abstract class dbHandlerBase {
try { try {
if (rs.next()) { if (rs.next()) {
abstractGameObject = localClass.getConstructor(ResultSet.class).newInstance(rs); abstractGameObject = localClass.getConstructor(ResultSet.class).newInstance(rs);
DbManager.addToCache(abstractGameObject); DbManager.addToCache(abstractGameObject);
} }
} catch (Exception e) { } catch (Exception e) {
@@ -41,7 +42,7 @@ public abstract class dbHandlerBase {
// Only call runAfterLoad() for objects instanced on the world server // Only call runAfterLoad() for objects instanced on the world server
if ((abstractGameObject != null && abstractGameObject instanceof AbstractWorldObject) && if ((abstractGameObject != null && abstractGameObject instanceof AbstractWorldObject) &&
(ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER) || (ConfigManager.serverType.equals(mbEnums.ServerType.WORLDSERVER) ||
(abstractGameObject.getObjectType() == GameObjectType.Guild))) (abstractGameObject.getObjectType() == GameObjectType.Guild)))
((AbstractWorldObject) abstractGameObject).runAfterLoad(); ((AbstractWorldObject) abstractGameObject).runAfterLoad();
@@ -56,28 +57,15 @@ public abstract class dbHandlerBase {
while (rs.next()) { while (rs.next()) {
int id = rs.getInt(1); int id = rs.getInt(1);
try {
if (rs.getInt("capSize") == 0) { if (id == 39052)
continue; Logger.info(id);
}
}catch(Exception e){
//not a mine
}
if (DbManager.inCache(localObjectType, id)) { if (DbManager.inCache(localObjectType, id)) {
objectList.add((T) DbManager.getFromCache(localObjectType, id)); objectList.add((T) DbManager.getFromCache(localObjectType, id));
} else { } else {
try{
if(rs.getInt("mineLiveHour") == 1)
continue;
}catch(Exception e){
//not a mine
}
AbstractGameObject toAdd = localClass.getConstructor(ResultSet.class).newInstance(rs); AbstractGameObject toAdd = localClass.getConstructor(ResultSet.class).newInstance(rs);
DbManager.addToCache(toAdd); DbManager.addToCache(toAdd);
if(toAdd.getObjectType().equals(GameObjectType.Zone) && rs.getInt("canLoad") == 0){
continue;
}
objectList.add((T) toAdd); objectList.add((T) toAdd);
if (toAdd != null && toAdd instanceof AbstractWorldObject) if (toAdd != null && toAdd instanceof AbstractWorldObject)
@@ -1,43 +0,0 @@
package engine.db.handlers;
import engine.InterestManagement.HeightMap;
import engine.gameManager.DbManager;
import org.pmw.tinylog.Logger;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class dbHeightMapHandler extends dbHandlerBase {
public dbHeightMapHandler() {
}
public void LOAD_ALL_HEIGHTMAPS() {
HeightMap thisHeightmap;
HeightMap.heightMapsCreated = 0;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_zone_heightmap INNER JOIN static_zone_size ON static_zone_size.loadNum = static_zone_heightmap.zoneLoadID")) {
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
thisHeightmap = new HeightMap(rs);
if (thisHeightmap.getHeightmapImage() == null) {
Logger.info("Imagemap for " + thisHeightmap.getHeightMapID() + " was null");
continue;
}
}
} catch (SQLException e) {
Logger.error(e);
}
}
}
@@ -1,162 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.db.handlers;
import engine.gameManager.DbManager;
import engine.objects.ItemBase;
import org.pmw.tinylog.Logger;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
public class dbItemBaseHandler extends dbHandlerBase {
public static final HashMap<Integer,Float> dexReductions = new HashMap<>();
public dbItemBaseHandler() {
}
public void LOAD_BAKEDINSTATS(ItemBase itemBase) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_item_bakedinstat` WHERE `itemID` = ?")) {
preparedStatement.setInt(1, itemBase.getUUID());
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
if (rs.getBoolean("fromUse"))
itemBase.getUsedStats().put(rs.getInt("token"), rs.getInt("numTrains"));
else
itemBase.getBakedInStats().put(rs.getInt("token"), rs.getInt("numTrains"));
}
} catch (SQLException e) {
Logger.error(e);
}
}
public void LOAD_DEX_REDUCTION(ItemBase itemBase) {
if(dexReductions.containsKey(itemBase.getUUID())){
itemBase.dexReduction = dexReductions.get(itemBase.getUUID());
}else{
itemBase.dexReduction = 0.0f;
}
}
public void LOAD_ANIMATIONS(ItemBase itemBase) {
ArrayList<Integer> tempList = new ArrayList<>();
ArrayList<Integer> tempListOff = new ArrayList<>();
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_itembase_animations` WHERE `itemBaseUUID` = ?")) {
preparedStatement.setInt(1, itemBase.getUUID());
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
int animation = rs.getInt("animation");
boolean rightHand = rs.getBoolean("rightHand");
if (rightHand)
tempList.add(animation);
else
tempListOff.add(animation);
}
} catch (SQLException e) {
Logger.error(e);
}
itemBase.setAnimations(tempList);
itemBase.setOffHandAnimations(tempListOff);
}
public void LOAD_ALL_ITEMBASES() {
ItemBase itemBase;
int recordsRead = 0;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_itembase")) {
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
recordsRead++;
itemBase = new ItemBase(rs);
ItemBase.addToCache(itemBase);
}
} catch (SQLException e) {
Logger.error(e);
}
Logger.info("read: " + recordsRead + " cached: " + ItemBase.getUUIDCache().size());
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_item_dexpenalty`")) {
ResultSet rs = preparedStatement.executeQuery();
// Check if a result was found
if (rs.next()) {
int ID = rs.getInt("ID");
float factor = rs.getInt("item_bulk_factor");
dexReductions.put(ID,factor);
}
} catch (SQLException e) {
Logger.error(e);
}
}
public HashMap<Integer, ArrayList<Integer>> LOAD_RUNES_FOR_NPC_AND_MOBS() {
HashMap<Integer, ArrayList<Integer>> runeSets = new HashMap<>();
int runeSetID;
int runeBaseID;
int recordsRead = 0;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_npc_runeSet")) {
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
recordsRead++;
runeSetID = rs.getInt("runeSet");
runeBaseID = rs.getInt("runeBase");
if (runeSets.get(runeSetID) == null) {
ArrayList<Integer> runeList = new ArrayList<>();
runeList.add(runeBaseID);
runeSets.put(runeSetID, runeList);
} else {
ArrayList<Integer> runeList = runeSets.get(runeSetID);
runeList.add(runeSetID);
runeSets.put(runeSetID, runeList);
}
}
} catch (SQLException e) {
Logger.error(e);
return runeSets;
}
Logger.info("read: " + recordsRead + " cached: " + runeSets.size());
return runeSets;
}
}
+131 -54
View File
@@ -3,18 +3,21 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum.ItemContainerType;
import engine.Enum.ItemType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.ItemContainerType;
import engine.mbEnums.ItemType;
import engine.objects.AbstractCharacter; import engine.objects.AbstractCharacter;
import engine.objects.CharacterItemManager; import engine.objects.CharacterItemManager;
import engine.objects.Item; import engine.objects.Item;
import engine.objects.ItemTemplate;
import org.json.JSONObject;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
@@ -22,6 +25,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
@@ -29,7 +33,7 @@ public class dbItemHandler extends dbHandlerBase {
public dbItemHandler() { public dbItemHandler() {
this.localClass = Item.class; this.localClass = Item.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
private static String formatTradeString(HashSet<Integer> list) { private static String formatTradeString(HashSet<Integer> list) {
@@ -52,46 +56,56 @@ public class dbItemHandler extends dbHandlerBase {
return ret; return ret;
} }
public Item ADD_ITEM(Item toAdd) { public Item PERSIST(Item toAdd) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("CALL `item_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?,?);")) { PreparedStatement preparedStatement = connection.prepareStatement("CALL `item_CREATE`(?, ?, ?, ?, ?, ?, ?, ?,?);")) {
preparedStatement.setInt(1, toAdd.getOwnerID()); preparedStatement.setInt(1, toAdd.ownerID);
preparedStatement.setInt(2, toAdd.getItemBaseID()); preparedStatement.setInt(2, toAdd.templateID);
preparedStatement.setInt(3, toAdd.getChargesRemaining()); preparedStatement.setInt(3, (byte) toAdd.chargesRemaining);
preparedStatement.setInt(4, toAdd.getDurabilityCurrent()); preparedStatement.setInt(4, (short) toAdd.combat_health_current);
preparedStatement.setInt(5, toAdd.getDurabilityMax());
if (toAdd.getNumOfItems() < 1) if (toAdd.getNumOfItems() < 1)
preparedStatement.setInt(6, 1); preparedStatement.setInt(5, 1);
else else
preparedStatement.setInt(6, toAdd.getNumOfItems()); preparedStatement.setInt(5, toAdd.getNumOfItems());
switch (toAdd.containerType) { switch (toAdd.containerType) {
case INVENTORY: case INVENTORY:
preparedStatement.setString(7, "inventory"); preparedStatement.setString(6, "inventory");
break; break;
case EQUIPPED: case EQUIPPED:
preparedStatement.setString(7, "equip"); preparedStatement.setString(6, "equip");
break; break;
case BANK: case BANK:
preparedStatement.setString(7, "bank"); preparedStatement.setString(6, "bank");
break; break;
case VAULT: case VAULT:
preparedStatement.setString(7, "vault"); preparedStatement.setString(6, "vault");
break; break;
case FORGE: case FORGE:
preparedStatement.setString(7, "forge"); preparedStatement.setString(6, "forge");
break; break;
default: default:
preparedStatement.setString(7, "none"); //Shouldn't be here preparedStatement.setString(6, "none"); //Shouldn't be here
break; break;
} }
preparedStatement.setByte(8, toAdd.getEquipSlot()); if (toAdd.equipSlot.equals(mbEnums.EquipSlotType.NONE))
preparedStatement.setInt(9, toAdd.getFlags()); preparedStatement.setString(7, "");
preparedStatement.setString(10, toAdd.getCustomName()); else
preparedStatement.setString(7, toAdd.equipSlot.name());
String flagString = "";
for (mbEnums.ItemFlags itemflag : toAdd.flags)
flagString += itemflag.toString() + ";";
flagString = flagString.replaceAll(";$", "");
preparedStatement.setString(8, flagString);
preparedStatement.setString(9, toAdd.name);
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
@@ -134,13 +148,9 @@ public class dbItemHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) { if (rs.next())
try {
worked = rs.getBoolean("result"); worked = rs.getBoolean("result");
}catch(Exception e){
worked = false;
}
}
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
} }
@@ -152,7 +162,7 @@ public class dbItemHandler extends dbHandlerBase {
ArrayList<Item> itemList; ArrayList<Item> itemList;
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_item`.*, `object`.`parent`, `object`.`type` FROM `object` INNER JOIN `obj_item` ON `object`.`UID` = `obj_item`.`UID` WHERE `object`.`parent`=? && `obj_item`.`item_container`='equip';")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_item`.*, `object`.`parent`, `object`.`type` FROM `object` INNER JOIN `obj_item` ON `object`.`UID` = `obj_item`.`UID` WHERE `object`.`parent`=? && `obj_item`.`container`='equip';")) {
preparedStatement.setLong(1, targetId); preparedStatement.setLong(1, targetId);
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
@@ -167,6 +177,49 @@ public class dbItemHandler extends dbHandlerBase {
return itemList; return itemList;
} }
public void LOAD_ITEM_TEMPLATES() {
HashMap<ItemType, Integer> templateTCountMap = new HashMap<>();
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_item_templates`;");
ResultSet rs = preparedStatement.executeQuery()) {
while (rs.next()) {
int templateID = rs.getInt("id");
JSONObject jsonObject = new JSONObject(rs.getString("template"));
ItemTemplate itemTemplate = new ItemTemplate(jsonObject);
itemTemplate.template_id = templateID;
ItemTemplate.templates.put(templateID, itemTemplate);
templateTCountMap.merge(itemTemplate.item_type, 1, Integer::sum);
}
Logger.info(templateTCountMap.toString());
} catch (Exception e) {
Logger.error(e);
}
}
public void LOAD_TEMPLATE_MODTABLES() {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_vendor_items`;");
ResultSet rs = preparedStatement.executeQuery()) {
while (rs.next()) {
int templateID = rs.getInt("templateID");
int modTable = rs.getInt("modTable");
ItemTemplate template = ItemTemplate.templates.get(templateID);
template.modTable = modTable;
}
} catch (Exception e) {
Logger.error(e);
}
}
public Item GET_ITEM(final int itemUUID) { public Item GET_ITEM(final int itemUUID) {
Item item; Item item;
@@ -246,7 +299,7 @@ public class dbItemHandler extends dbHandlerBase {
public boolean MOVE_GOLD(final Item from, final Item to, final int amt) { public boolean MOVE_GOLD(final Item from, final Item to, final int amt) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `item_numberOfItems` = CASE WHEN `UID`=? THEN ? WHEN `UID`=? THEN ? END WHERE `UID` IN (?, ?);")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `numberOfItems` = CASE WHEN `UID`=? THEN ? WHEN `UID`=? THEN ? END WHERE `UID` IN (?, ?);")) {
int newFromAmt = from.getNumOfItems() - amt; int newFromAmt = from.getNumOfItems() - amt;
int newToAmt = to.getNumOfItems() + amt; int newToAmt = to.getNumOfItems() + amt;
@@ -272,11 +325,11 @@ public class dbItemHandler extends dbHandlerBase {
for (Item item : inventory) { for (Item item : inventory) {
if (item.getItemBase().getType().equals(ItemType.GOLD)) if (item.template.item_type.equals(ItemType.GOLD))
continue; continue;
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` LEFT JOIN `object` ON `object`.`UID` = `obj_item`.`UID` SET `object`.`parent`=NULL, `obj_item`.`item_container`='none' WHERE `object`.`UID`=?;")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` LEFT JOIN `object` ON `object`.`UID` = `obj_item`.`UID` SET `object`.`parent`=NULL, `obj_item`.`container`='none' WHERE `object`.`UID`=?;")) {
preparedStatement.setLong(1, item.getObjectUUID()); preparedStatement.setLong(1, item.getObjectUUID());
worked = (preparedStatement.executeUpdate() > 0); worked = (preparedStatement.executeUpdate() > 0);
@@ -292,12 +345,12 @@ public class dbItemHandler extends dbHandlerBase {
return worked; return worked;
} }
public HashSet<Integer> GET_ITEMS_FOR_VENDOR(final int vendorID) { public HashSet<Integer> GET_VENDOR_CAN_ROLL_LIST(final int vendorID) {
HashSet<Integer> itemSet = new HashSet<>(); HashSet<Integer> itemSet = new HashSet<>();
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT ID FROM static_itembase WHERE vendorType = ?")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT templateID FROM static_vendor_items WHERE vendorType = ?")) {
preparedStatement.setInt(1, vendorID); preparedStatement.setInt(1, vendorID);
@@ -315,8 +368,8 @@ public class dbItemHandler extends dbHandlerBase {
} }
//Used to transfer a single item between owners or equip or vault or bank or inventory //Used to transfer a single item between owners or equip or vault or bank or inventory
public boolean UPDATE_OWNER(final Item item, int newOwnerID, boolean ownerNPC, boolean ownerPlayer, public boolean UPDATE_OWNER(final Item item, int newOwnerID,
boolean ownerAccount, ItemContainerType containerType, int slot) { ItemContainerType containerType, mbEnums.EquipSlotType slot) {
boolean worked = false; boolean worked = false;
@@ -350,7 +403,12 @@ public class dbItemHandler extends dbHandlerBase {
preparedStatement.setString(3, "none"); //Shouldn't be here preparedStatement.setString(3, "none"); //Shouldn't be here
break; break;
} }
preparedStatement.setInt(4, slot);
if (slot.equals(mbEnums.EquipSlotType.NONE))
preparedStatement.setString(4, "");
else
preparedStatement.setString(4, slot.name());
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) if (rs.next())
@@ -366,11 +424,11 @@ public class dbItemHandler extends dbHandlerBase {
public boolean SET_DURABILITY(final Item item, int value) { public boolean SET_DURABILITY(final Item item, int value) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `item_durabilityCurrent`=? WHERE `UID`=? AND `item_durabilityCurrent`=?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `combat_health_current`=? WHERE `UID`=? AND `combat_health_current`=?")) {
preparedStatement.setInt(1, value); preparedStatement.setInt(1, value);
preparedStatement.setLong(2, item.getObjectUUID()); preparedStatement.setLong(2, item.getObjectUUID());
preparedStatement.setInt(3, item.getDurabilityCurrent()); preparedStatement.setInt(3, (short) item.combat_health_current);
return (preparedStatement.executeUpdate() > 0); return (preparedStatement.executeUpdate() > 0);
@@ -383,7 +441,7 @@ public class dbItemHandler extends dbHandlerBase {
public boolean UPDATE_FORGE_TO_INVENTORY(final Item item) { public boolean UPDATE_FORGE_TO_INVENTORY(final Item item) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `item_container` = ? WHERE `UID` = ? AND `item_container` = 'forge';")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `container` = ? WHERE `UID` = ? AND `container` = 'forge';")) {
preparedStatement.setString(1, "inventory"); preparedStatement.setString(1, "inventory");
preparedStatement.setLong(2, item.getObjectUUID()); preparedStatement.setLong(2, item.getObjectUUID());
@@ -416,11 +474,11 @@ public class dbItemHandler extends dbHandlerBase {
*/ */
public boolean UPDATE_GOLD(final Item item, int newValue, int oldValue) { public boolean UPDATE_GOLD(final Item item, int newValue, int oldValue) {
if (!item.getItemBase().getType().equals(ItemType.GOLD)) if (!item.template.item_type.equals(ItemType.GOLD))
return false; return false;
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `item_numberOfItems`=? WHERE `UID`=?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `numberOfItems`=? WHERE `UID`=?")) {
preparedStatement.setInt(1, newValue); preparedStatement.setInt(1, newValue);
preparedStatement.setLong(2, item.getObjectUUID()); preparedStatement.setLong(2, item.getObjectUUID());
@@ -437,9 +495,9 @@ public class dbItemHandler extends dbHandlerBase {
public boolean UPDATE_REMAINING_CHARGES(final Item item) { public boolean UPDATE_REMAINING_CHARGES(final Item item) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `item_chargesRemaining` = ? WHERE `UID` = ?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `chargesRemaining` = ? WHERE `UID` = ?")) {
preparedStatement.setInt(1, item.getChargesRemaining()); preparedStatement.setInt(1, (byte) item.chargesRemaining);
preparedStatement.setLong(2, item.getObjectUUID()); preparedStatement.setLong(2, item.getObjectUUID());
return (preparedStatement.executeUpdate() > 0); return (preparedStatement.executeUpdate() > 0);
@@ -457,7 +515,7 @@ public class dbItemHandler extends dbHandlerBase {
public boolean ZERO_ITEM_STACK(Item item) { public boolean ZERO_ITEM_STACK(Item item) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `item_numberOfItems`=0 WHERE `UID` = ?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `numberOfItems`=0 WHERE `UID` = ?")) {
preparedStatement.setLong(1, item.getObjectUUID()); preparedStatement.setLong(1, item.getObjectUUID());
@@ -472,9 +530,16 @@ public class dbItemHandler extends dbHandlerBase {
public boolean UPDATE_FLAGS(Item item) { public boolean UPDATE_FLAGS(Item item) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `item_flags`=? WHERE `UID` = ?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `flags`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, item.getFlags()); String flagString = "";
for (mbEnums.ItemFlags itemflag : item.flags)
flagString += itemflag.toString() + ";";
flagString = flagString.replaceAll(";$", "");
preparedStatement.setString(1, flagString);
preparedStatement.setLong(2, item.getObjectUUID()); preparedStatement.setLong(2, item.getObjectUUID());
return (preparedStatement.executeUpdate() > 0); return (preparedStatement.executeUpdate() > 0);
@@ -487,8 +552,13 @@ public class dbItemHandler extends dbHandlerBase {
public boolean UPDATE_VALUE(Item item, int value) { public boolean UPDATE_VALUE(Item item, int value) {
// Write 0 if we will not modify the value from template
if (value == item.template.item_value)
value = 0;
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `item_value`=? WHERE `UID` = ?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `value`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, value); preparedStatement.setInt(1, value);
preparedStatement.setLong(2, item.getObjectUUID()); preparedStatement.setLong(2, item.getObjectUUID());
@@ -501,17 +571,24 @@ public class dbItemHandler extends dbHandlerBase {
} }
} }
public boolean UPDATE_NUM_ITEMS(final Item item, int newValue) { public boolean UPDATE_EQUIP_SLOT(Item item) {
if (item.getItemBase().getType().equals(ItemType.GOLD))
return false;
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `item_numberOfItems`=? WHERE `UID`=?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `equipSlot`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, newValue);
if (item.equipSlot.equals(mbEnums.EquipSlotType.NONE))
preparedStatement.setString(1, "");
else
preparedStatement.setString(1, item.equipSlot.name());
preparedStatement.setLong(2, item.getObjectUUID()); preparedStatement.setLong(2, item.getObjectUUID());
return (preparedStatement.executeUpdate() > 0); return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
return false; return false;
} }
} }
} }
+4 -3
View File
@@ -3,13 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Kit; import engine.objects.Kit;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -23,7 +24,7 @@ public class dbKitHandler extends dbHandlerBase {
public dbKitHandler() { public dbKitHandler() {
this.localClass = Kit.class; this.localClass = Kit.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<Kit> GET_ALL_KITS() { public ArrayList<Kit> GET_ALL_KITS() {
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
+4 -3
View File
@@ -3,13 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.MenuOption; import engine.objects.MenuOption;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -23,7 +24,7 @@ public class dbMenuHandler extends dbHandlerBase {
public dbMenuHandler() { public dbMenuHandler() {
this.localClass = MenuOption.class; this.localClass = MenuOption.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<MenuOption> GET_MENU_OPTIONS(final int id) { public ArrayList<MenuOption> GET_MENU_OPTIONS(final int id) {
+6 -7
View File
@@ -3,16 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Mine; import engine.objects.Mine;
import engine.objects.MineProduction; import engine.objects.MineProduction;
import engine.objects.Resource;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
@@ -25,7 +24,7 @@ public class dbMineHandler extends dbHandlerBase {
public dbMineHandler() { public dbMineHandler() {
this.localClass = Mine.class; this.localClass = Mine.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public Mine GET_MINE(int id) { public Mine GET_MINE(int id) {
@@ -33,7 +32,7 @@ public class dbMineHandler extends dbHandlerBase {
if (id == 0) if (id == 0)
return null; return null;
Mine mine = (Mine) DbManager.getFromCache(Enum.GameObjectType.Mine, id); Mine mine = (Mine) DbManager.getFromCache(mbEnums.GameObjectType.Mine, id);
if (mine != null) if (mine != null)
return mine; return mine;
@@ -84,7 +83,7 @@ public class dbMineHandler extends dbHandlerBase {
return false; return false;
} }
public boolean CHANGE_RESOURCE(Mine mine, Resource resource) { public boolean CHANGE_RESOURCE(Mine mine, mbEnums.ResourceType resource) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_mine` SET `mine_resource`=? WHERE `UID`=?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_mine` SET `mine_resource`=? WHERE `UID`=?")) {
+5 -4
View File
@@ -3,14 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum.GameObjectType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.objects.MobBase; import engine.objects.MobBase;
import engine.objects.MobBaseEffects; import engine.objects.MobBaseEffects;
import engine.objects.MobBaseStats; import engine.objects.MobBaseStats;
@@ -26,7 +27,7 @@ public class dbMobBaseHandler extends dbHandlerBase {
public dbMobBaseHandler() { public dbMobBaseHandler() {
this.localClass = MobBase.class; this.localClass = MobBase.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public MobBase GET_MOBBASE(int id) { public MobBase GET_MOBBASE(int id) {
+55 -49
View File
@@ -3,16 +3,17 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Mob; import engine.objects.Mob;
import engine.objects.Zone; import java.time.LocalDateTime;
import org.joda.time.DateTime; import java.time.ZoneId;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
@@ -25,34 +26,30 @@ public class dbMobHandler extends dbHandlerBase {
public dbMobHandler() { public dbMobHandler() {
this.localClass = Mob.class; this.localClass = Mob.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public Mob ADD_MOB(Mob toAdd) { public Mob PERSIST(Mob toAdd) {
Mob mobile = null; Mob mobile = null;
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("CALL `mob_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);")) { PreparedStatement preparedStatement = connection.prepareStatement("CALL `mob_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);")) {
preparedStatement.setLong(1, toAdd.getParentZoneID()); preparedStatement.setLong(1, toAdd.parentZoneUUID);
preparedStatement.setInt(2, toAdd.getMobBaseID()); preparedStatement.setInt(2, toAdd.loadID);
preparedStatement.setInt(3, toAdd.getGuildUUID()); preparedStatement.setInt(3, toAdd.guildUUID);
preparedStatement.setFloat(4, toAdd.getSpawnX()); preparedStatement.setFloat(4, toAdd.bindLoc.x);
preparedStatement.setFloat(5, toAdd.getSpawnY()); preparedStatement.setFloat(5, toAdd.bindLoc.y);
preparedStatement.setFloat(6, toAdd.getSpawnZ()); preparedStatement.setFloat(6, toAdd.bindLoc.z);
preparedStatement.setInt(7, 0); preparedStatement.setInt(7, 0);
preparedStatement.setFloat(8, toAdd.getSpawnRadius()); preparedStatement.setFloat(8, toAdd.spawnRadius);
preparedStatement.setInt(9, toAdd.getTrueSpawnTime()); preparedStatement.setInt(9, toAdd.spawnDelay);
preparedStatement.setInt(10, toAdd.contractUUID);
if (toAdd.getContract() != null) preparedStatement.setInt(11, toAdd.buildingUUID);
preparedStatement.setInt(10, toAdd.getContract().getContractID()); preparedStatement.setInt(12, toAdd.level);
else preparedStatement.setString(13, toAdd.firstName);
preparedStatement.setInt(10, 0); preparedStatement.setString(14, toAdd.behaviourType.toString());
preparedStatement.setInt(11, toAdd.getBuildingID());
preparedStatement.setInt(12, toAdd.getLevel());
preparedStatement.setString(13, toAdd.getFirstName());
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
@@ -69,7 +66,24 @@ public class dbMobHandler extends dbHandlerBase {
return mobile; return mobile;
} }
public boolean updateUpgradeTime(Mob mob, DateTime upgradeDateTime) { public ArrayList<Mob> GET_ALL_MOBS() {
ArrayList<Mob> mobileList = new ArrayList<>();
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_mob`.*, `object`.`parent` FROM `object` INNER JOIN `obj_mob` ON `obj_mob`.`UID` = `object`.`UID` ORDER BY `object`.`UID` ASC;")) {
ResultSet rs = preparedStatement.executeQuery();
mobileList = getObjectsFromRs(rs, 1000);
} catch (SQLException e) {
Logger.error(e);
}
return mobileList;
}
public boolean updateUpgradeTime(Mob mob, LocalDateTime upgradeDateTime) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_mob SET upgradeDate=? " PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_mob SET upgradeDate=? "
@@ -78,7 +92,7 @@ public class dbMobHandler extends dbHandlerBase {
if (upgradeDateTime == null) if (upgradeDateTime == null)
preparedStatement.setNull(1, java.sql.Types.DATE); preparedStatement.setNull(1, java.sql.Types.DATE);
else else
preparedStatement.setTimestamp(1, new java.sql.Timestamp(upgradeDateTime.getMillis())); preparedStatement.setTimestamp(1, new java.sql.Timestamp(upgradeDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()));
preparedStatement.setInt(2, mob.getObjectUUID()); preparedStatement.setInt(2, mob.getObjectUUID());
@@ -106,17 +120,17 @@ public class dbMobHandler extends dbHandlerBase {
return row_count; return row_count;
} }
public void LOAD_PATROL_POINTS(Mob captain) { public void LOAD_GUARD_MINIONS(Mob guardCaptain) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_guards` WHERE `captainUID` = ?")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_guards` WHERE `captainUID` = ?")) {
preparedStatement.setInt(1, captain.getObjectUUID()); preparedStatement.setInt(1, guardCaptain.getObjectUUID());
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) { while (rs.next()) {
String name = rs.getString("name"); String minionName = rs.getString("minionName");
Mob toCreate = Mob.createGuardMob(captain, captain.getGuild(), captain.getParentZone(), captain.building.getLoc(), captain.getLevel(), name); Mob toCreate = Mob.createGuardMinion(guardCaptain, guardCaptain.getLevel(), minionName);
if (toCreate == null) if (toCreate == null)
return; return;
@@ -131,15 +145,13 @@ public class dbMobHandler extends dbHandlerBase {
} }
} }
public boolean ADD_TO_GUARDS(final long captainUID, final int mobBaseID, final String name, final int slot) { public boolean ADD_GUARD_MINION(final long captainUID, final String minionName) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_guards` (`captainUID`, `mobBaseID`,`name`, `slot`) VALUES (?,?,?,?)")) { PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_guards` (`captainUID`, `minionName`) VALUES (?,?)")) {
preparedStatement.setLong(1, captainUID); preparedStatement.setLong(1, captainUID);
preparedStatement.setInt(2, mobBaseID); preparedStatement.setString(2, minionName);
preparedStatement.setString(3, name);
preparedStatement.setInt(4, slot);
return (preparedStatement.executeUpdate() > 0); return (preparedStatement.executeUpdate() > 0);
@@ -149,14 +161,13 @@ public class dbMobHandler extends dbHandlerBase {
} }
} }
public boolean REMOVE_FROM_GUARDS(final long captainUID, final int mobBaseID, final int slot) { public boolean REMOVE_GUARD_MINION(final long captainUID, final String minionName) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("DELETE FROM `dyn_guards` WHERE `captainUID`=? AND `mobBaseID`=? AND `slot` =?")) { PreparedStatement preparedStatement = connection.prepareStatement("DELETE FROM `dyn_guards` WHERE `captainUID`=? AND `minionName`=? LIMIT 1;")) {
preparedStatement.setLong(1, captainUID); preparedStatement.setLong(1, captainUID);
preparedStatement.setInt(2, mobBaseID); preparedStatement.setString(2, minionName);
preparedStatement.setInt(3, slot);
return (preparedStatement.executeUpdate() > 0); return (preparedStatement.executeUpdate() > 0);
@@ -166,24 +177,19 @@ public class dbMobHandler extends dbHandlerBase {
} }
} }
public boolean REMOVE_ALL_MINIONS(final long captainUID) {
public ArrayList<Mob> GET_ALL_MOBS_FOR_ZONE(Zone zone) {
ArrayList<Mob> mobileList = new ArrayList<>();
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_mob`.*, `object`.`parent` FROM `object` INNER JOIN `obj_mob` ON `obj_mob`.`UID` = `object`.`UID` WHERE `object`.`parent` = ?;")) { PreparedStatement preparedStatement = connection.prepareStatement("DELETE FROM `dyn_guards` WHERE `captainUID`=?;")) {
preparedStatement.setLong(1, zone.getObjectUUID()); preparedStatement.setLong(1, captainUID);
ResultSet rs = preparedStatement.executeQuery(); return (preparedStatement.executeUpdate() > 0);
mobileList = getObjectsFromRs(rs, 1000);
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
return false;
} }
return mobileList;
} }
public Mob GET_MOB(final int objectUUID) { public Mob GET_MOB(final int objectUUID) {
+67 -162
View File
@@ -3,20 +3,20 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum.ProfitType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.mbEnums.ProfitType;
import engine.objects.NPC; import engine.objects.NPC;
import engine.objects.NPCProfits; import engine.objects.NPCProfits;
import engine.objects.ProducedItem; import java.time.LocalDateTime;
import engine.objects.Zone; import java.time.ZoneId;
import org.joda.time.DateTime;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
@@ -24,12 +24,52 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
public class dbNPCHandler extends dbHandlerBase { public class dbNPCHandler extends dbHandlerBase {
public dbNPCHandler() { public dbNPCHandler() {
this.localClass = NPC.class; this.localClass = NPC.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
}
public static HashMap<Integer, ArrayList<Integer>> LOAD_RUNES_FOR_NPC_AND_MOBS() {
HashMap<Integer, ArrayList<Integer>> runeSets = new HashMap<>();
int runeSetID;
int runeBaseID;
int recordsRead = 0;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_npc_runeSet")) {
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
recordsRead++;
runeSetID = rs.getInt("runeSet");
runeBaseID = rs.getInt("runeBase");
if (runeSets.get(runeSetID) == null) {
ArrayList<Integer> runeList = new ArrayList<>();
runeList.add(runeBaseID);
runeSets.put(runeSetID, runeList);
} else {
ArrayList<Integer> runeList = runeSets.get(runeSetID);
runeList.add(runeSetID);
runeSets.put(runeSetID, runeList);
}
}
} catch (SQLException e) {
Logger.error(e);
return runeSets;
}
Logger.info("read: " + recordsRead + " cached: " + runeSets.size());
return runeSets;
} }
public NPC PERSIST(NPC toAdd) { public NPC PERSIST(NPC toAdd) {
@@ -94,14 +134,12 @@ public class dbNPCHandler extends dbHandlerBase {
return row_count; return row_count;
} }
public ArrayList<NPC> GET_ALL_NPCS_FOR_ZONE(Zone zone) { public ArrayList<NPC> GET_ALL_NPCS() {
ArrayList<NPC> npcList = new ArrayList<>(); ArrayList<NPC> npcList = new ArrayList<>();
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_npc`.*, `object`.`parent` FROM `object` INNER JOIN `obj_npc` ON `obj_npc`.`UID` = `object`.`UID` WHERE `object`.`parent` = ?;")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_npc`.*, `object`.`parent` FROM `object` INNER JOIN `obj_npc` ON `obj_npc`.`UID` = `object`.`UID` ORDER BY `object`.`UID` ASC;")) {
preparedStatement.setLong(1, zone.getObjectUUID());
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
npcList = getObjectsFromRs(rs, 1000); npcList = getObjectsFromRs(rs, 1000);
@@ -131,32 +169,6 @@ public class dbNPCHandler extends dbHandlerBase {
return npc; return npc;
} }
public int BANE_COMMANDER_EXISTS(final int objectUUID) {
int uid = 0;
String query = "SELECT `UID` FROM `obj_npc` WHERE `npc_buildingID` = ? LIMIT 1;";
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement(query)) {
preparedStatement.setInt(1, objectUUID);
try (ResultSet rs = preparedStatement.executeQuery()) {
if (rs.next()) {
// Retrieve the UID column value
uid = rs.getInt("UID");
}
}
} catch (SQLException e) {
Logger.error(e);
}
return uid;
}
public int MOVE_NPC(long npcID, long parentID, float locX, float locY, float locZ) { public int MOVE_NPC(long npcID, long parentID, float locX, float locY, float locZ) {
int rowCount; int rowCount;
@@ -202,18 +214,6 @@ public class dbNPCHandler extends dbHandlerBase {
return result; return result;
} }
public static void updateSpecialPricing(final NPC npc){
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_npc SET specialPrice=? WHERE UID = ?")) {
preparedStatement.setInt(1, npc.getSpecialPrice());
preparedStatement.setInt(2, npc.getDBID());
preparedStatement.executeUpdate();
} catch (SQLException e) {
Logger.error(e);
}
}
public void updateDatabase(final NPC npc) { public void updateDatabase(final NPC npc) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
@@ -241,7 +241,7 @@ public class dbNPCHandler extends dbHandlerBase {
} }
} }
public boolean updateUpgradeTime(NPC npc, DateTime upgradeDateTime) { public boolean updateUpgradeTime(NPC npc, LocalDateTime upgradeDateTime) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_npc SET upgradeDate=? " PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_npc SET upgradeDate=? "
@@ -250,7 +250,7 @@ public class dbNPCHandler extends dbHandlerBase {
if (upgradeDateTime == null) if (upgradeDateTime == null)
preparedStatement.setNull(1, java.sql.Types.DATE); preparedStatement.setNull(1, java.sql.Types.DATE);
else else
preparedStatement.setTimestamp(1, new java.sql.Timestamp(upgradeDateTime.getMillis())); preparedStatement.setTimestamp(1, new java.sql.Timestamp(upgradeDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()));
preparedStatement.setInt(2, npc.getObjectUUID()); preparedStatement.setInt(2, npc.getObjectUUID());
@@ -311,6 +311,22 @@ public class dbNPCHandler extends dbHandlerBase {
} }
} }
public boolean UPDATE_RACE(NPC npc, int value) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_npc` SET `npc_raceID`=? WHERE `UID`=?")) {
preparedStatement.setInt(1, value);
preparedStatement.setLong(2, npc.getObjectUUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
return false;
}
}
public void LOAD_PIRATE_NAMES() { public void LOAD_PIRATE_NAMES() {
String pirateName; String pirateName;
@@ -346,117 +362,6 @@ public class dbNPCHandler extends dbHandlerBase {
+ NPC._pirateNames.size() + " mobBases"); + NPC._pirateNames.size() + " mobBases");
} }
public boolean ADD_TO_PRODUCTION_LIST(final long ID, final long npcUID, final long itemBaseID, DateTime dateTime, String prefix, String suffix, String name, boolean isRandom, int playerID) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_npc_production` (`ID`,`npcUID`, `itemBaseID`,`dateToUpgrade`, `isRandom`, `prefix`, `suffix`, `name`,`playerID`) VALUES (?,?,?,?,?,?,?,?,?)")) {
preparedStatement.setLong(1, ID);
preparedStatement.setLong(2, npcUID);
preparedStatement.setLong(3, itemBaseID);
preparedStatement.setTimestamp(4, new java.sql.Timestamp(dateTime.getMillis()));
preparedStatement.setBoolean(5, isRandom);
preparedStatement.setString(6, prefix);
preparedStatement.setString(7, suffix);
preparedStatement.setString(8, name);
preparedStatement.setInt(9, playerID);
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
return false;
}
}
public boolean REMOVE_FROM_PRODUCTION_LIST(final long ID, final long npcUID) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("DELETE FROM `dyn_npc_production` WHERE `ID`=? AND `npcUID`=?;")) {
preparedStatement.setLong(1, ID);
preparedStatement.setLong(2, npcUID);
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
return false;
}
}
public boolean UPDATE_ITEM_TO_INVENTORY(final long ID, final long npcUID) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_npc_production` SET `inForge`=? WHERE `ID`=? AND `npcUID`=?;")) {
preparedStatement.setByte(1, (byte) 0);
preparedStatement.setLong(2, ID);
preparedStatement.setLong(3, npcUID);
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
return false;
}
}
public boolean UPDATE_ITEM_PRICE(final long ID, final long npcUID, int value) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_npc_production` SET `value`=? WHERE `ID`=? AND `npcUID`=?;")) {
preparedStatement.setInt(1, value);
preparedStatement.setLong(2, ID);
preparedStatement.setLong(3, npcUID);
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
return false;
}
}
public boolean UPDATE_ITEM_ID(final long ID, final long npcUID, final long value) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_npc_production` SET `ID`=? WHERE `ID`=? AND `npcUID`=? LIMIT 1;")) {
preparedStatement.setLong(1, value);
preparedStatement.setLong(2, ID);
preparedStatement.setLong(3, npcUID);
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
return false;
}
}
public void LOAD_ALL_ITEMS_TO_PRODUCE(NPC npc) {
if (npc == null)
return;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_npc_production` WHERE `npcUID` = ?")) {
preparedStatement.setInt(1, npc.getObjectUUID());
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
ProducedItem producedItem = new ProducedItem(rs);
npc.forgedItems.add(producedItem);
}
} catch (SQLException e) {
Logger.error(e);
}
}
public boolean UPDATE_PROFITS(NPC npc, ProfitType profitType, float value) { public boolean UPDATE_PROFITS(NPC npc, ProfitType profitType, float value) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Petition; import engine.objects.Petition;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -58,8 +58,8 @@ public class dbPetitionHandler extends dbHandlerBase {
" VALUES (?,?,?,?,?,?,?,?,?);")) { " VALUES (?,?,?,?,?,?,?,?,?);")) {
preparedStatement.setTimestamp(1, new java.sql.Timestamp(System.currentTimeMillis())); preparedStatement.setTimestamp(1, new java.sql.Timestamp(System.currentTimeMillis()));
preparedStatement.setString(2, Enum.PetitionType.values()[petition.primaryType].name()); preparedStatement.setString(2, mbEnums.PetitionType.values()[petition.primaryType].name());
preparedStatement.setString(3, Enum.PetitionSubType.values()[petition.subType].name()); preparedStatement.setString(3, mbEnums.PetitionSubType.values()[petition.subType].name());
preparedStatement.setInt(4, petition.reportAccount.getObjectUUID()); preparedStatement.setInt(4, petition.reportAccount.getObjectUUID());
preparedStatement.setString(5, petition.reportAccount.getUname()); preparedStatement.setString(5, petition.reportAccount.getUname());
preparedStatement.setInt(6, petition.reportPlayer.getObjectUUID()); preparedStatement.setInt(6, petition.reportPlayer.getObjectUUID());
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import engine.objects.Heraldry; import engine.objects.Heraldry;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@@ -29,7 +29,7 @@ public class dbPlayerCharacterHandler extends dbHandlerBase {
public dbPlayerCharacterHandler() { public dbPlayerCharacterHandler() {
this.localClass = PlayerCharacter.class; this.localClass = PlayerCharacter.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public PlayerCharacter ADD_PLAYER_CHARACTER(final PlayerCharacter toAdd) { public PlayerCharacter ADD_PLAYER_CHARACTER(final PlayerCharacter toAdd) {
@@ -45,8 +45,8 @@ public class dbPlayerCharacterHandler extends dbHandlerBase {
preparedStatement.setLong(1, toAdd.getAccount().getObjectUUID()); preparedStatement.setLong(1, toAdd.getAccount().getObjectUUID());
preparedStatement.setString(2, toAdd.getFirstName()); preparedStatement.setString(2, toAdd.getFirstName());
preparedStatement.setString(3, toAdd.getLastName()); preparedStatement.setString(3, toAdd.getLastName());
preparedStatement.setInt(4, toAdd.getRace().getRaceRuneID()); preparedStatement.setInt(4, toAdd.race.getRaceRuneID());
preparedStatement.setInt(5, toAdd.getBaseClass().getObjectUUID()); preparedStatement.setInt(5, toAdd.baseClass.getObjectUUID());
preparedStatement.setInt(6, toAdd.getStrMod()); preparedStatement.setInt(6, toAdd.getStrMod());
preparedStatement.setInt(7, toAdd.getDexMod()); preparedStatement.setInt(7, toAdd.getDexMod());
preparedStatement.setInt(8, toAdd.getConMod()); preparedStatement.setInt(8, toAdd.getConMod());
@@ -176,7 +176,7 @@ public class dbPlayerCharacterHandler extends dbHandlerBase {
if (objectUUID == 0) if (objectUUID == 0)
return null; return null;
PlayerCharacter playerCharacter = (PlayerCharacter) DbManager.getFromCache(Enum.GameObjectType.PlayerCharacter, objectUUID); PlayerCharacter playerCharacter = (PlayerCharacter) DbManager.getFromCache(mbEnums.GameObjectType.PlayerCharacter, objectUUID);
if (playerCharacter != null) if (playerCharacter != null)
return playerCharacter; return playerCharacter;
+17 -63
View File
@@ -3,68 +3,63 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.mbEnums;
import engine.objects.Mob; import engine.objects.Mob;
import engine.objects.PreparedStatementShared;
import engine.powers.EffectsBase; import engine.powers.EffectsBase;
import engine.powers.MobPowerEntry;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
public class dbPowerHandler extends dbHandlerBase { public class dbPowerHandler extends dbHandlerBase {
public dbPowerHandler() { public dbPowerHandler() {
this.localClass = Mob.class; this.localClass = Mob.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static void addAllSourceTypes() { public static void addAllSourceTypes() {
PreparedStatementShared ps = null;
try { try (Connection connection = DbManager.getConnection();
ps = new PreparedStatementShared("SELECT * FROM static_power_sourcetype"); PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_power_sourcetype")) {
ResultSet rs = ps.executeQuery();
ResultSet rs = preparedStatement.executeQuery();
String IDString, source; String IDString, source;
while (rs.next()) { while (rs.next()) {
IDString = rs.getString("IDString"); IDString = rs.getString("IDString");
int token = DbManager.hasher.SBStringHash(IDString); int token = DbManager.hasher.SBStringHash(IDString);
source = rs.getString("source").replace("-", "").trim(); source = rs.getString("source").replace("-", "").trim();
Enum.EffectSourceType effectSourceType = Enum.EffectSourceType.GetEffectSourceType(source); mbEnums.EffectSourceType effectSourceType = mbEnums.EffectSourceType.GetEffectSourceType(source);
if (EffectsBase.effectSourceTypeMap.containsKey(token) == false) if (EffectsBase.effectSourceTypeMap.containsKey(token) == false)
EffectsBase.effectSourceTypeMap.put(token, new HashSet<>()); EffectsBase.effectSourceTypeMap.put(token, new HashSet<>());
EffectsBase.effectSourceTypeMap.get(token).add(effectSourceType); EffectsBase.effectSourceTypeMap.get(token).add(effectSourceType);
} }
rs.close();
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);
} finally {
ps.release();
} }
} }
public static void addAllAnimationOverrides() { public static void addAllAnimationOverrides() {
PreparedStatementShared ps = null;
try { try (Connection connection = DbManager.getConnection();
ps = new PreparedStatementShared("SELECT * FROM static_power_animation_override"); PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_power_animation_override")) {
ResultSet rs = ps.executeQuery();
ResultSet rs = preparedStatement.executeQuery();
String IDString; String IDString;
int animation; int animation;
while (rs.next()) { while (rs.next()) {
@@ -78,51 +73,10 @@ public class dbPowerHandler extends dbHandlerBase {
PowersManager.AnimationOverrides.put(IDString, animation); PowersManager.AnimationOverrides.put(IDString, animation);
} }
rs.close();
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);
} finally {
ps.release();
} }
}
public static HashMap<Integer, ArrayList<MobPowerEntry>> LOAD_MOB_POWERS() {
HashMap<Integer, ArrayList<MobPowerEntry>> mobPowers = new HashMap<>();
MobPowerEntry mobPowerEntry;
int mobbaseID;
int recordsRead = 0;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_npc_mobbase_powers ORDER BY `id` ASC;")) {
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
recordsRead++;
mobbaseID = rs.getInt("mobbaseUUID");
mobPowerEntry = new MobPowerEntry(rs);
if (mobPowers.get(mobbaseID) == null) {
ArrayList<MobPowerEntry> powerList = new ArrayList<>();
powerList.add(mobPowerEntry);
mobPowers.put(mobbaseID, powerList);
} else {
ArrayList<MobPowerEntry> powerList = mobPowers.get(mobbaseID);
powerList.add(mobPowerEntry);
mobPowers.put(mobbaseID, powerList);
}
}
} catch (SQLException e) {
Logger.error(e);
return mobPowers;
}
Logger.info("read: " + recordsRead + " cached: " + mobPowers.size());
return mobPowers;
} }
} }
@@ -3,13 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.PromotionClass; import engine.objects.PromotionClass;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -23,7 +24,7 @@ public class dbPromotionClassHandler extends dbHandlerBase {
public dbPromotionClassHandler() { public dbPromotionClassHandler() {
this.localClass = PromotionClass.class; this.localClass = PromotionClass.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<Integer> GET_ALLOWED_RUNES(final PromotionClass pc) { public ArrayList<Integer> GET_ALLOWED_RUNES(final PromotionClass pc) {
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
@@ -3,13 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.RuneBaseAttribute; import engine.objects.RuneBaseAttribute;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -23,7 +24,7 @@ public class dbRuneBaseAttributeHandler extends dbHandlerBase {
public dbRuneBaseAttributeHandler() { public dbRuneBaseAttributeHandler() {
this.localClass = RuneBaseAttribute.class; this.localClass = RuneBaseAttribute.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<RuneBaseAttribute> GET_ATTRIBUTES_FOR_RUNEBASE() { public ArrayList<RuneBaseAttribute> GET_ATTRIBUTES_FOR_RUNEBASE() {
@@ -3,14 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum.GameObjectType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.RuneBaseEffect; import engine.objects.RuneBaseEffect;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -26,7 +27,7 @@ public class dbRuneBaseEffectHandler extends dbHandlerBase {
public dbRuneBaseEffectHandler() { public dbRuneBaseEffectHandler() {
this.localClass = RuneBaseEffect.class; this.localClass = RuneBaseEffect.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<RuneBaseEffect> GET_EFFECTS_FOR_RUNEBASE(int id) { public ArrayList<RuneBaseEffect> GET_EFFECTS_FOR_RUNEBASE(int id) {
+84 -3
View File
@@ -3,14 +3,17 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.RuneBase; import engine.objects.RuneBase;
import engine.powers.RunePowerEntry;
import engine.powers.RuneSkillAdjustEntry;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
@@ -24,7 +27,85 @@ public class dbRuneBaseHandler extends dbHandlerBase {
public dbRuneBaseHandler() { public dbRuneBaseHandler() {
this.localClass = RuneBase.class; this.localClass = RuneBase.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
}
public static HashMap<Integer, ArrayList<RunePowerEntry>> LOAD_RUNE_POWERS() {
HashMap<Integer, ArrayList<RunePowerEntry>> mobPowers = new HashMap<>();
RunePowerEntry runePowerEntry;
int rune_id;
int recordsRead = 0;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_rune_powers")) {
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
recordsRead++;
rune_id = rs.getInt("rune_id");
runePowerEntry = new RunePowerEntry(rs);
if (mobPowers.get(rune_id) == null) {
ArrayList<RunePowerEntry> runePowerList = new ArrayList<>();
runePowerList.add(runePowerEntry);
mobPowers.put(rune_id, runePowerList);
} else {
ArrayList<RunePowerEntry> powerList = mobPowers.get(rune_id);
powerList.add(runePowerEntry);
mobPowers.put(rune_id, powerList);
}
}
} catch (SQLException e) {
Logger.error(e);
return mobPowers;
}
Logger.info("read: " + recordsRead + " cached: " + mobPowers.size());
return mobPowers;
}
public static HashMap<Integer, ArrayList<RuneSkillAdjustEntry>> LOAD_RUNE_SKILL_ADJUSTS() {
HashMap<Integer, ArrayList<RuneSkillAdjustEntry>> runeSkillAdjusts = new HashMap<>();
RuneSkillAdjustEntry runeSkillAdjustEntry;
int rune_id;
int recordsRead = 0;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_rune_skill_adjusts")) {
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
recordsRead++;
rune_id = rs.getInt("rune_id");
runeSkillAdjustEntry = new RuneSkillAdjustEntry(rs);
if (runeSkillAdjusts.get(rune_id) == null) {
ArrayList<RuneSkillAdjustEntry> skillAdjustList = new ArrayList<>();
skillAdjustList.add(runeSkillAdjustEntry);
runeSkillAdjusts.put(rune_id, skillAdjustList);
} else {
ArrayList<RuneSkillAdjustEntry> powerList = runeSkillAdjusts.get(rune_id);
powerList.add(runeSkillAdjustEntry);
runeSkillAdjusts.put(rune_id, powerList);
}
}
} catch (SQLException e) {
Logger.error(e);
return runeSkillAdjusts;
}
Logger.info("read: " + recordsRead + " cached: " + runeSkillAdjusts.size());
return runeSkillAdjusts;
} }
public void GET_RUNE_REQS(final RuneBase rb) { public void GET_RUNE_REQS(final RuneBase rb) {
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Building; import engine.objects.Building;
import engine.objects.Portal; import engine.objects.Portal;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -49,7 +49,7 @@ public class dbRunegateHandler extends dbHandlerBase {
public ArrayList<Portal> GET_PORTAL_LIST(int gateUID) { public ArrayList<Portal> GET_PORTAL_LIST(int gateUID) {
ArrayList<Portal> portalList = new ArrayList<>(); ArrayList<Portal> portalList = new ArrayList<>();
Building sourceBuilding = (Building) DbManager.getObject(Enum.GameObjectType.Building, gateUID); Building sourceBuilding = (Building) DbManager.getObject(mbEnums.GameObjectType.Building, gateUID);
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_runegate_portals` WHERE `sourceBuilding` = ?;")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_runegate_portals` WHERE `sourceBuilding` = ?;")) {
@@ -60,8 +60,8 @@ public class dbRunegateHandler extends dbHandlerBase {
while (rs.next()) { while (rs.next()) {
int targetBuildingID = rs.getInt("targetBuilding"); int targetBuildingID = rs.getInt("targetBuilding");
Building targetBuilding = (Building) DbManager.getObject(Enum.GameObjectType.Building, targetBuildingID); Building targetBuilding = (Building) DbManager.getObject(mbEnums.GameObjectType.Building, targetBuildingID);
Enum.PortalType portalType = Enum.PortalType.valueOf(rs.getString("portalType")); mbEnums.PortalType portalType = mbEnums.PortalType.valueOf(rs.getString("portalType"));
Portal portal = new Portal(sourceBuilding, portalType, targetBuilding); Portal portal = new Portal(sourceBuilding, portalType, targetBuilding);
portalList.add(portal); portalList.add(portal);
} }
+8 -7
View File
@@ -3,19 +3,20 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum.ProtectionState;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.mbEnums.ProtectionState;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.Building; import engine.objects.Building;
import engine.objects.Shrine; import engine.objects.Shrine;
import org.joda.time.DateTime; import java.time.Instant;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
@@ -28,7 +29,7 @@ public class dbShrineHandler extends dbHandlerBase {
public dbShrineHandler() { public dbShrineHandler() {
this.localClass = Shrine.class; this.localClass = Shrine.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static void addObject(ArrayList<AbstractGameObject> list, ResultSet rs) throws SQLException { public static void addObject(ArrayList<AbstractGameObject> list, ResultSet rs) throws SQLException {
@@ -52,7 +53,7 @@ public class dbShrineHandler extends dbHandlerBase {
public ArrayList<AbstractGameObject> CREATE_SHRINE(int parentZoneID, int OwnerUUID, String name, int meshUUID, public ArrayList<AbstractGameObject> CREATE_SHRINE(int parentZoneID, int OwnerUUID, String name, int meshUUID,
Vector3fImmutable location, float meshScale, int currentHP, Vector3fImmutable location, float meshScale, int currentHP,
ProtectionState protectionState, int currentGold, int rank, ProtectionState protectionState, int currentGold, int rank,
DateTime upgradeDate, int blueprintUUID, float w, float rotY, String shrineType) { Instant upgradeDate, int blueprintUUID, float w, float rotY, String shrineType) {
ArrayList<AbstractGameObject> shrineList = new ArrayList<>(); ArrayList<AbstractGameObject> shrineList = new ArrayList<>();
@@ -73,7 +74,7 @@ public class dbShrineHandler extends dbHandlerBase {
preparedStatement.setInt(12, rank); preparedStatement.setInt(12, rank);
if (upgradeDate != null) if (upgradeDate != null)
preparedStatement.setTimestamp(13, new java.sql.Timestamp(upgradeDate.getMillis())); preparedStatement.setTimestamp(13, java.sql.Timestamp.from(upgradeDate));
else else
preparedStatement.setNull(13, java.sql.Types.DATE); preparedStatement.setNull(13, java.sql.Types.DATE);
@@ -3,15 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.objects.MaxSkills; import engine.objects.MaxSkills;
import engine.objects.SkillsBase; import engine.objects.SkillsBase;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -27,7 +27,7 @@ public class dbSkillBaseHandler extends dbHandlerBase {
public dbSkillBaseHandler() { public dbSkillBaseHandler() {
this.localClass = SkillsBase.class; this.localClass = SkillsBase.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public SkillsBase GET_BASE(final int objectUUID) { public SkillsBase GET_BASE(final int objectUUID) {
@@ -3,13 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.SkillReq; import engine.objects.SkillReq;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -25,7 +26,7 @@ public class dbSkillReqHandler extends dbHandlerBase {
public dbSkillReqHandler() { public dbSkillReqHandler() {
this.localClass = SkillReq.class; this.localClass = SkillReq.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static ArrayList<PowersBase> getAllPowersBase() { public static ArrayList<PowersBase> getAllPowersBase() {
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.VendorDialog; import engine.objects.VendorDialog;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -23,12 +23,12 @@ public class dbVendorDialogHandler extends dbHandlerBase {
public dbVendorDialogHandler() { public dbVendorDialogHandler() {
this.localClass = VendorDialog.class; this.localClass = VendorDialog.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public VendorDialog GET_VENDORDIALOG(final int objectUUID) { public VendorDialog GET_VENDORDIALOG(final int objectUUID) {
VendorDialog vendorDialog = (VendorDialog) DbManager.getFromCache(Enum.GameObjectType.VendorDialog, objectUUID); VendorDialog vendorDialog = (VendorDialog) DbManager.getFromCache(mbEnums.GameObjectType.VendorDialog, objectUUID);
if (vendorDialog != null) if (vendorDialog != null)
return vendorDialog; return vendorDialog;
+156 -477
View File
@@ -3,20 +3,26 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum.GameObjectType;
import engine.Enum.ProtectionState;
import engine.Enum.TransactionType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.math.Vector3fImmutable; import engine.gameManager.ForgeManager;
import engine.objects.*; import engine.loot.WorkOrder;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.mbEnums.TransactionType;
import engine.objects.Building;
import engine.objects.City;
import engine.objects.Transaction;
import engine.objects.Warehouse;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.joda.time.DateTime; import java.time.Instant;
import org.json.JSONArray;
import org.json.JSONObject;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
@@ -31,463 +37,10 @@ public class dbWarehouseHandler extends dbHandlerBase {
private static final ConcurrentHashMap<Integer, String> columns = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); private static final ConcurrentHashMap<Integer, String> columns = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
public dbWarehouseHandler() { public dbWarehouseHandler() {
this.localClass = Warehouse.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static void addObject(ArrayList<AbstractGameObject> list, ResultSet rs) throws SQLException { public boolean CREATE_TRANSACTION(int warehouseBuildingID, GameObjectType targetType, int targetUUID, TransactionType transactionType, mbEnums.ResourceType resource, int amount, Instant date) {
String type = rs.getString("type");
switch (type) {
case "building":
Building building = new Building(rs);
DbManager.addToCache(building);
list.add(building);
break;
case "warehouse":
Warehouse warehouse = new Warehouse(rs);
DbManager.addToCache(warehouse);
list.add(warehouse);
break;
}
}
public ArrayList<AbstractGameObject> CREATE_WAREHOUSE(int parentZoneID, int OwnerUUID, String name, int meshUUID,
Vector3fImmutable location, float meshScale, int currentHP,
ProtectionState protectionState, int currentGold, int rank,
DateTime upgradeDate, int blueprintUUID, float w, float rotY) {
ArrayList<AbstractGameObject> warehouseList = new ArrayList<>();
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("CALL `WAREHOUSE_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,? ,? ,?, ?);")) {
preparedStatement.setInt(1, parentZoneID);
preparedStatement.setInt(2, OwnerUUID);
preparedStatement.setString(3, name);
preparedStatement.setInt(4, meshUUID);
preparedStatement.setFloat(5, location.x);
preparedStatement.setFloat(6, location.y);
preparedStatement.setFloat(7, location.z);
preparedStatement.setFloat(8, meshScale);
preparedStatement.setInt(9, currentHP);
preparedStatement.setString(10, protectionState.name());
preparedStatement.setInt(11, currentGold);
preparedStatement.setInt(12, rank);
if (upgradeDate != null)
preparedStatement.setTimestamp(13, new java.sql.Timestamp(upgradeDate.getMillis()));
else
preparedStatement.setNull(13, java.sql.Types.DATE);
preparedStatement.setInt(14, blueprintUUID);
preparedStatement.setFloat(15, w);
preparedStatement.setFloat(16, rotY);
preparedStatement.execute();
ResultSet rs = preparedStatement.getResultSet();
while (rs.next())
addObject(warehouseList, rs);
while (preparedStatement.getMoreResults()) {
rs = preparedStatement.getResultSet();
while (rs.next())
addObject(warehouseList, rs);
}
} catch (SQLException e) {
Logger.error(e);
}
return warehouseList;
}
public boolean updateLocks(final Warehouse wh, long locks) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_locks`=? WHERE `UID` = ?")) {
preparedStatement.setLong(1, locks);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateGold(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_gold`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateStone(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_stone`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateTruesteel(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_truesteel`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateIron(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_iron`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateAdamant(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_adamant`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateLumber(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_lumber`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateOak(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_oak`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateBronzewood(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_bronzewood`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateMandrake(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_mandrake`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateCoal(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_coal`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateAgate(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_agate`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateDiamond(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_diamond`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateOnyx(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_onyx`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateAzoth(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_azoth`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateOrichalk(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_orichalk`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateAntimony(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_antimony`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateSulfur(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_sulfur`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateQuicksilver(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_quicksilver`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateGalvor(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_galvor`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateWormwood(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_wormwood`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateObsidian(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_obsidian`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateBloodstone(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_bloodstone`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean updateMithril(final Warehouse wh, int amount) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_warehouse` SET `warehouse_mithril`=? WHERE `UID` = ?")) {
preparedStatement.setInt(1, amount);
preparedStatement.setInt(2, wh.getUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public boolean CREATE_TRANSACTION(int warehouseBuildingID, GameObjectType targetType, int targetUUID, TransactionType transactionType, Resource resource, int amount, DateTime date) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_warehouse_transactions` (`warehouseUID`, `targetType`,`targetUID`, `type`,`resource`,`amount`,`date` ) VALUES (?,?,?,?,?,?,?)")) { PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_warehouse_transactions` (`warehouseUID`, `targetType`,`targetUID`, `type`,`resource`,`amount`,`date` ) VALUES (?,?,?,?,?,?,?)")) {
@@ -498,7 +51,7 @@ public class dbWarehouseHandler extends dbHandlerBase {
preparedStatement.setString(4, transactionType.name()); preparedStatement.setString(4, transactionType.name());
preparedStatement.setString(5, resource.name()); preparedStatement.setString(5, resource.name());
preparedStatement.setInt(6, amount); preparedStatement.setInt(6, amount);
preparedStatement.setTimestamp(7, new java.sql.Timestamp(date.getMillis())); preparedStatement.setTimestamp(7, new java.sql.Timestamp(date.toEpochMilli()));
return (preparedStatement.executeUpdate() > 0); return (preparedStatement.executeUpdate() > 0);
@@ -532,24 +85,150 @@ public class dbWarehouseHandler extends dbHandlerBase {
return transactionsList; return transactionsList;
} }
public void LOAD_ALL_WAREHOUSES() { public void DELETE_WAREHOUSE(Warehouse warehouse) {
Warehouse warehouse;
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_warehouse`.*, `object`.`parent`, `object`.`type` FROM `object` LEFT JOIN `obj_warehouse` ON `object`.`UID` = `obj_warehouse`.`UID` WHERE `object`.`type` = 'warehouse';")) { PreparedStatement preparedStatement = connection.prepareStatement("DELETE FROM `dyn_warehouse` WHERE `cityUUID` = ?;")) {
preparedStatement.setInt(1, warehouse.city.getObjectUUID());
preparedStatement.executeUpdate();
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
warehouse = new Warehouse(rs);
warehouse.runAfterLoad();
warehouse.loadAllTransactions();
}
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
} }
}
public boolean UPDATE_WAREHOUSE(Warehouse warehouse) {
JSONObject warehouseJSON = new JSONObject();
JSONObject resources = new JSONObject(warehouse.resources);
warehouseJSON.put("resources", resources);
JSONArray locks = new JSONArray();
for (mbEnums.ResourceType resource : warehouse.locked)
locks.put(resource.name());
warehouseJSON.put("locked", locks);
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_warehouse` (`cityUUID`, `warehouse`) VALUES (?, ?) " +
"ON DUPLICATE KEY UPDATE `warehouse` = VALUES(`warehouse`)")) {
preparedStatement.setInt(1, warehouse.city.getObjectUUID());
preparedStatement.setString(2, warehouseJSON.toString());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public void LOAD_WAREHOUSES() {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_warehouse`;");
ResultSet rs = preparedStatement.executeQuery()) {
while (rs.next()) {
int cityUID = rs.getInt("cityUUID");
JSONObject jsonObject = new JSONObject(rs.getString("warehouse"));
City city = City.getCity(cityUID);
if (city == null) {
Logger.error("No city " + cityUID + " for warehouse");
continue;
}
city.warehouse = new Warehouse(jsonObject);
city.warehouse.city = city;
// Locate warehouse building
for (Building building : city.parentZone.zoneBuildingSet) {
if (building.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.WAREHOUSE)) {
city.warehouse.building = building;
break;
}
}
}
} catch (Exception e) {
Logger.error(e);
}
}
public boolean WRITE_WORKORDER(WorkOrder workOrder) {
JSONObject warehouseJSON = WorkOrder.toJson(workOrder);
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_workorders` (`workorderID`, `workorder`) VALUES (?, ?) " +
"ON DUPLICATE KEY UPDATE `workorder` = VALUES(`workorder`)")) {
preparedStatement.setInt(1, workOrder.workOrderID);
preparedStatement.setString(2, warehouseJSON.toString());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
}
return false;
}
public void DELETE_WORKORDER(WorkOrder workOrder) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("DELETE FROM `dyn_workorders` WHERE `workorderID` = ?;")) {
preparedStatement.setInt(1, workOrder.workOrderID);
preparedStatement.executeUpdate();
} catch (SQLException e) {
Logger.error(e);
}
}
public void LOAD_WORKORDERS() {
// Method loads NPC workOrders from disk at bootstrap.
// A workOrder will persist until completed or junked
// via the client interface.
ArrayList<WorkOrder> submitList = new ArrayList<>();
ArrayList<WorkOrder> orphanList = new ArrayList<>();
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_workorders`;");
ResultSet rs = preparedStatement.executeQuery()) {
while (rs.next()) {
JSONObject jsonObject = new JSONObject(rs.getString("workorder"));
WorkOrder workOrder = new WorkOrder(jsonObject);
submitList.add(workOrder);
}
} catch (Exception e) {
Logger.error(e);
}
// Submit new workOrders to the ForgeManager
for (WorkOrder workOrder : submitList) {
DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder);
// Delete but do not reconstitute orphan workOrders
if (workOrder.vendor == null)
continue;
workOrder.workOrderID = ForgeManager.workOrderCounter.incrementAndGet();
DbManager.WarehouseQueries.WRITE_WORKORDER(workOrder);
ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder);
ForgeManager.forge.add(workOrder);
}
} }
} }
+41 -50
View File
@@ -3,17 +3,17 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector2f; import engine.mbEnums;
import engine.objects.Zone; import engine.objects.Zone;
import engine.objects.ZoneTemplate;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.Connection; import java.sql.Connection;
@@ -26,33 +26,29 @@ public class dbZoneHandler extends dbHandlerBase {
public dbZoneHandler() { public dbZoneHandler() {
this.localClass = Zone.class; this.localClass = Zone.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<Zone> GET_ALL_NODES(Zone zone) { public ArrayList<Zone> GET_ALL_ZONES() {
ArrayList<Zone> wsmList = new ArrayList<>();
wsmList.addAll(zone.getNodes()); ArrayList<Zone> zoneList = new ArrayList<>();
if (zone.absX == 0.0f) {
zone.absX = zone.getXCoord(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_zone`.*, `object`.`parent` FROM `object` INNER JOIN `obj_zone` ON `obj_zone`.`UID` = `object`.`UID` ORDER BY `object`.`UID` ASC;")) {
ResultSet rs = preparedStatement.executeQuery();
zoneList = getObjectsFromRs(rs, 2000);
} catch (SQLException e) {
Logger.error(e);
} }
if (zone.absY == 0.0f) {
zone.absY = zone.getYCoord(); return zoneList;
}
if (zone.absZ == 0.0f) {
zone.absZ = zone.getZCoord();
}
for (Zone child : zone.getNodes()) {
child.absX = child.getXCoord() + zone.absX;
child.absY = child.getYCoord() + zone.absY;
child.absZ = child.getZCoord() + zone.absZ;
wsmList.addAll(this.GET_ALL_NODES(child));
}
return wsmList;
} }
public Zone GET_BY_UID(long ID) { public Zone GET_BY_UID(long ID) {
Zone zone = (Zone) DbManager.getFromCache(Enum.GameObjectType.Zone, (int) ID); Zone zone = (Zone) DbManager.getFromCache(mbEnums.GameObjectType.Zone, (int) ID);
if (zone != null) if (zone != null)
return zone; return zone;
@@ -72,43 +68,38 @@ public class dbZoneHandler extends dbHandlerBase {
return zone; return zone;
} }
public ArrayList<Zone> GET_MAP_NODES(final int objectUUID) { public void LOAD_ALL_ZONE_TEMPLATES() {
ArrayList<Zone> zoneList = new ArrayList<>();
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_zone`.*, `object`.`parent` FROM `object` INNER JOIN `obj_zone` ON `obj_zone`.`UID` = `object`.`UID` WHERE `object`.`parent` = ?;")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_zone_templates")) {
preparedStatement.setLong(1, objectUUID);
ResultSet rs = preparedStatement.executeQuery();
zoneList = getObjectsFromRs(rs, 2000);
} catch (SQLException e) {
Logger.error(e);
}
return zoneList;
}
public void LOAD_ZONE_EXTENTS() {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_zone_size`;")) {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) { while (rs.next()) {
Vector2f zoneSize = new Vector2f(); ZoneTemplate zoneTemplate = new ZoneTemplate(rs);
int loadNum = rs.getInt("loadNum"); ZoneManager._zone_templates.put(zoneTemplate.templateID, zoneTemplate);
zoneSize.x = rs.getFloat("xRadius");
zoneSize.y = rs.getFloat("zRadius");
ZoneManager._zone_size_data.put(loadNum, zoneSize);
} }
// Add player city
ZoneTemplate zoneTemplate = new ZoneTemplate();
zoneTemplate.templateID = 0;
zoneTemplate.sea_level_type = "PARENT";
zoneTemplate.sea_level = 0;
zoneTemplate.max_blend = 128;
zoneTemplate.min_blend = 128;
zoneTemplate.terrain_max_y = 5;
zoneTemplate.major_radius = (int) mbEnums.CityBoundsType.ZONE.halfExtents;
zoneTemplate.minor_radius = (int) mbEnums.CityBoundsType.ZONE.halfExtents;
zoneTemplate.terrain_type = "PLANAR";
ZoneManager._zone_templates.put(zoneTemplate.templateID, zoneTemplate);
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
} }
} }
public boolean DELETE_ZONE(final Zone zone) { public boolean DELETE_ZONE(final Zone zone) {
+3 -3
View File
@@ -3,15 +3,15 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.devcmd; package engine.devcmd;
import engine.Enum.GameObjectType;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums.GameObjectType;
import engine.objects.*; import engine.objects.*;
import java.util.ArrayList; import java.util.ArrayList;
+3 -3
View File
@@ -3,13 +3,12 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.ProtectionState;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
@@ -17,6 +16,7 @@ import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3f; import engine.math.Vector3f;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums.ProtectionState;
import engine.objects.*; import engine.objects.*;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
+5 -5
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.devcmd.cmds; package engine.devcmd.cmds;
@@ -32,7 +32,7 @@ public class AddGoldCmd extends AbstractDevCmd {
return; return;
} }
Item gold = pc.getCharItemManager().getGoldInventory(); Item gold = pc.charItemManager.getGoldInventory();
int curAmt; int curAmt;
if (gold == null) if (gold == null)
curAmt = 0; curAmt = 0;
@@ -54,13 +54,13 @@ public class AddGoldCmd extends AbstractDevCmd {
return; return;
} }
if (!pc.getCharItemManager().addGoldToInventory(amt, true)) { if (!pc.charItemManager.addGoldToInventory(amt, true)) {
throwbackError(pc, "Failed to add gold to inventory"); throwbackError(pc, "Failed to add gold to inventory");
return; return;
} }
ChatManager.chatSayInfo(pc, amt + " gold added to inventory"); ChatManager.chatSayInfo(pc, amt + " gold added to inventory");
pc.getCharItemManager().updateInventory(); pc.charItemManager.updateInventory();
} }
@Override @Override
+11 -33
View File
@@ -3,24 +3,22 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3fImmutable; import engine.mbEnums;
import engine.objects.*; import engine.objects.AbstractGameObject;
import engine.objects.Mob;
import engine.objects.PlayerCharacter;
import engine.objects.Zone;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
/**
* @author Eighty
*/
public class AddMobCmd extends AbstractDevCmd { public class AddMobCmd extends AbstractDevCmd {
public AddMobCmd() { public AddMobCmd() {
@@ -37,27 +35,8 @@ public class AddMobCmd extends AbstractDevCmd {
Zone zone = ZoneManager.findSmallestZone(pc.getLoc()); Zone zone = ZoneManager.findSmallestZone(pc.getLoc());
if (words[0].equals("all")) {
for (AbstractGameObject mobbaseAGO : DbManager.getList(GameObjectType.MobBase)) {
MobBase mb = (MobBase) mobbaseAGO;
int loadID = mb.getObjectUUID();
Mob mob = Mob.createMob(loadID, Vector3fImmutable.getRandomPointInCircle(pc.getLoc(), 100),
null, true, zone, null, 0, "", 1);
if (mob != null) {
mob.updateDatabase();
this.setResult(String.valueOf(mob.getDBID()));
} else {
throwbackError(pc, "Failed to create mob of type " + loadID);
Logger.error("Failed to create mob of type "
+ loadID);
}
}
return;
}
int loadID; int loadID;
try { try {
loadID = Integer.parseInt(words[0]); loadID = Integer.parseInt(words[0]);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
@@ -71,20 +50,19 @@ public class AddMobCmd extends AbstractDevCmd {
return; // NaN return; // NaN
} }
if (zone == null) { if (zone == null) {
throwbackError(pc, "Failed to find zone to place mob in."); throwbackError(pc, "Failed to find zone to place mob in.");
return; return;
} }
if (zone.isPlayerCity()) { if (zone.guild_zone) {
throwbackError(pc, "Cannot use ./mob on Player cities. Try ./servermob instead."); throwbackError(pc, "Cannot use ./mob on Player cities. Try ./servermob instead.");
return; return;
} }
Mob mob = Mob.createMob(loadID, pc.getLoc(), Mob mob = Mob.createMob(loadID, pc.getLoc(),
null, true, zone, null, 0, "", 1); null, zone, null, null, "", 1, mbEnums.AIAgentType.MOBILE);
if (mob != null) { if (mob != null) {
mob.updateDatabase(); mob.updateDatabase();
ChatManager.chatSayInfo(pc, ChatManager.chatSayInfo(pc,
+28 -23
View File
@@ -3,17 +3,16 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.*; import engine.gameManager.*;
import engine.math.Vector3fImmutable; import engine.mbEnums.GameObjectType;
import engine.objects.*; import engine.objects.*;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -32,6 +31,7 @@ public class AddNPCCmd extends AbstractDevCmd {
int contractID; int contractID;
String name = ""; String name = "";
int level = 0; int level = 0;
if (words.length < 2) { if (words.length < 2) {
this.sendUsage(pc); this.sendUsage(pc);
return; return;
@@ -39,54 +39,59 @@ public class AddNPCCmd extends AbstractDevCmd {
try { try {
contractID = Integer.parseInt(words[0]); contractID = Integer.parseInt(words[0]);
level = Integer.parseInt(words[1]); level = Integer.parseInt(words[1]);
for (int i = 2; i < words.length; i++) { for (int i = 2; i < words.length; i++) {
name += words[i]; name += words[i];
if (i + 1 < words.length) if (i + 1 < words.length)
name += ""; name += "";
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throwbackError(pc, throwbackError(pc,
"Failed to parse supplied contractID or level to an Integer."); "Failed to parse supplied contractID or level to an Integer.");
return; // NaN return; // NaN
} }
Contract contract = DbManager.ContractQueries.GET_CONTRACT(contractID); Contract contract = DbManager.ContractQueries.GET_CONTRACT(contractID);
if (contract == null || level < 1 || level > 75) { if (contract == null || level < 1 || level > 75) {
throwbackError(pc, throwbackError(pc,
"Invalid addNPC Command. Need contract ID, and level"); "Invalid addNPC Command. Need contract ID, and level");
return; // NaN return; // NaN
} }
// Pick a random name // Pick a random name
if (name.isEmpty()) if (name.isEmpty())
name = NPCManager.getPirateName(contract.getMobbaseID()); name = NPCManager.getPirateName(contract.getMobbaseID());
Zone zone = ZoneManager.findSmallestZone(pc.getLoc()); Zone zone = ZoneManager.findSmallestZone(pc.getLoc());
if (zone == null) { if (zone == null) {
throwbackError(pc, "Failed to find zone to place npc in."); throwbackError(pc, "Failed to find zone to place npc in.");
return; return;
} }
Building building = null;
if (target != null) if (target != null)
if (target.getObjectType() == GameObjectType.Building) { if (target.getObjectType() == GameObjectType.Building) {
building = (Building)target; Building parentBuilding = (Building) target;
BuildingManager.addHirelingForWorld(parentBuilding, pc, parentBuilding.getLoc(), parentBuilding.getParentZone(), contract, level);
return;
} }
NPC created;
Guild guild = null; NPC npc = NPC.createNPC(name, contractID,
Vector3fImmutable loc; pc.getLoc(), null, zone, (short) level, null);
if(building != null){
guild = building.getGuild(); if (npc != null) {
loc = building.loc; WorldGrid.addObject(npc, pc);
ChatManager.chatSayInfo(pc,
"NPC with ID " + npc.getDBID() + " added");
this.setResult(String.valueOf(npc.getDBID()));
} else { } else {
loc = pc.loc; throwbackError(pc, "Failed to create npc of contract type "
+ contractID);
Logger.error(
"Failed to create npc of contract type " + contractID);
} }
created = NPC.createNPC(name, contractID, loc, guild, zone, (short)level, building);
created.bindLoc = loc;
if(building != null) {
created.buildingUUID = building.getObjectUUID();
created.building = building;
NPCManager.slotCharacterInBuilding(created);
}
created.setLoc(created.bindLoc);
created.updateDatabase();
throwbackInfo(pc, "Created NPC with UUID: " + created.getObjectUUID());
} }
@Override @Override
+3 -3
View File
@@ -3,16 +3,16 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.PowerActionType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.mbEnums.PowerActionType;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
+2 -2
View File
@@ -3,8 +3,8 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.devcmd.cmds; package engine.devcmd.cmds;
@@ -1,127 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.Enum.ModType;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.PowersManager;
import engine.net.ItemProductionManager;
import engine.objects.*;
import engine.powers.effectmodifiers.AbstractEffectModifier;
import engine.powers.poweractions.AbstractPowerAction;
import org.pmw.tinylog.Logger;
public class AuditFailedItemsCmd extends AbstractDevCmd {
public AuditFailedItemsCmd() {
super("faileditems");
}
@Override
protected void _doCmd(PlayerCharacter pcSender, String[] words,
AbstractGameObject target) {
if (ItemProductionManager.FailedItems.isEmpty())
return;
Logger.info("Auditing Item production Failed Items");
String newLine = "\r\n";
String auditFailedItem = "Failed Item Name | Prefix | Suffix | NPC | Contract | Player | ";
for (ProducedItem failedItem : ItemProductionManager.FailedItems) {
String npcName = "";
String playerName = "";
String contractName = "";
String prefix = "";
String suffix = "";
String itemName = "";
NPC npc = NPC.getFromCache(failedItem.getNpcUID());
if (npc == null) {
npcName = "null";
contractName = "null";
} else {
npcName = npc.getName();
if (npc.getContract() != null)
contractName = npc.getContract().getName();
}
PlayerCharacter roller = PlayerCharacter.getFromCache(failedItem.getPlayerID());
if (roller == null)
playerName = "null";
else
playerName = roller.getName();
ItemBase ib = ItemBase.getItemBase(failedItem.getItemBaseID());
if (ib != null) {
itemName = ib.getName();
}
if (failedItem.isRandom() == false) {
if (failedItem.getPrefix().isEmpty() == false) {
AbstractPowerAction pa = PowersManager.getPowerActionByIDString(failedItem.getPrefix());
if (pa != null) {
for (AbstractEffectModifier aem : pa.getEffectsBase().getModifiers()) {
if (aem.modType.equals(ModType.ItemName)) {
prefix = aem.getString1();
break;
}
}
}
}
if (failedItem.getSuffix().isEmpty() == false) {
AbstractPowerAction pa = PowersManager.getPowerActionByIDString(failedItem.getSuffix());
if (pa != null) {
for (AbstractEffectModifier aem : pa.getEffectsBase().getModifiers()) {
if (aem.modType.equals(ModType.ItemName)) {
suffix = aem.getString1();
break;
}
}
}
}
} else {
prefix = "random";
}
auditFailedItem += newLine;
auditFailedItem += itemName + " | " + prefix + " | " + suffix + " | " + failedItem.getNpcUID() + ":" + npcName + " | " + contractName + " | " + failedItem.getPlayerID() + ":" + playerName;
}
Logger.info(auditFailedItem);
ItemProductionManager.FailedItems.clear();
}
@Override
protected String _getUsageString() {
return "' /bounds'";
}
@Override
protected String _getHelpString() {
return "Audits all the mobs in a zone.";
}
}
@@ -1,70 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.InterestManagement.HeightMap;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ZoneManager;
import engine.math.Vector2f;
import engine.math.Vector3fImmutable;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
import engine.objects.Zone;
public class AuditHeightMapCmd extends AbstractDevCmd {
public AuditHeightMapCmd() {
super("auditheightmap");
}
@Override
protected void _doCmd(PlayerCharacter pcSender, String[] words,
AbstractGameObject target) {
int count = Integer.parseInt(words[0]);
long start = System.currentTimeMillis();
for (int i = 0; i < count; i++) {
Zone currentZone = ZoneManager.findSmallestZone(pcSender.getLoc());
Vector3fImmutable currentLoc = Vector3fImmutable.getRandomPointInCircle(currentZone.getLoc(), currentZone.getBounds().getHalfExtents().x < currentZone.getBounds().getHalfExtents().y ? currentZone.getBounds().getHalfExtents().x : currentZone.getBounds().getHalfExtents().y);
Vector2f zoneLoc = ZoneManager.worldToZoneSpace(currentLoc, currentZone);
if (currentZone != null && currentZone.getHeightMap() != null) {
float altitude = currentZone.getHeightMap().getInterpolatedTerrainHeight(zoneLoc);
float outsetAltitude = HeightMap.getOutsetHeight(altitude, currentZone, pcSender.getLoc());
}
}
long end = System.currentTimeMillis();
long delta = end - start;
this.throwbackInfo(pcSender, "Audit Heightmap took " + delta + " ms to run " + count + " times!");
}
@Override
protected String _getUsageString() {
return "' /auditmobs [zone.UUID]'";
}
@Override
protected String _getHelpString() {
return "Audits all the mobs in a zone.";
}
}
-105
View File
@@ -1,105 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ZoneManager;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
import engine.objects.Zone;
public class AuditMobsCmd extends AbstractDevCmd {
public AuditMobsCmd() {
super("auditmobs");
}
@Override
protected void _doCmd(PlayerCharacter pcSender, String[] words,
AbstractGameObject target) {
if (pcSender == null)
return;
//get Zone to check mobs against
Zone zone;
if (words.length == 2) {
if (words[0].equals("all")) {
int plusplus = 0;
int count = Integer.parseInt(words[1]);
for (Zone zoneMicro : ZoneManager.getAllZones()) {
int size = zoneMicro.zoneMobSet.size();
if (size >= count) {
plusplus++;
throwbackInfo(pcSender, zoneMicro.getName() + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. ");
System.out.println(zoneMicro.getName() + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. ");
}
}
throwbackInfo(pcSender, " there are " + plusplus + " zones with at least " + count + " mobs in each.");
}
return;
}
if (words.length > 1) {
this.sendUsage(pcSender);
return;
} else if (words.length == 1) {
int uuid;
try {
uuid = Integer.parseInt(words[0]);
zone = ZoneManager.getZoneByUUID(uuid);
} catch (NumberFormatException e) {
zone = ZoneManager.findSmallestZone(pcSender.getLoc());
}
} else
zone = ZoneManager.findSmallestZone(pcSender.getLoc());
if (zone == null) {
throwbackError(pcSender, "Unable to find the zone");
return;
}
//get list of mobs for zone
if (zone.zoneMobSet.isEmpty()) {
throwbackError(pcSender, "No mobs found for this zone.");
return;
}
// ConcurrentHashMap<Integer, Mob> spawnMap = Mob.getSpawnMap();
//ConcurrentHashMap<Mob, Long> respawnMap = Mob.getRespawnMap();
// ConcurrentHashMap<Mob, Long> despawnMap = Mob.getDespawnMap();
throwbackInfo(pcSender, zone.getName() + ", numMobs: " + zone.zoneMobSet.size());
throwbackInfo(pcSender, "UUID, dbID, inRespawnMap, isAlive, activeAI, Loc");
//mob not found in spawn map, check respawn
boolean inRespawn = false;
}
@Override
protected String _getUsageString() {
return "' /auditmobs [zone.UUID]'";
}
@Override
protected String _getHelpString() {
return "Audits all the mobs in a zone.";
}
}
+3 -3
View File
@@ -3,14 +3,14 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.mbEnums.GameObjectType;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.Building; import engine.objects.Building;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
-114
View File
@@ -1,114 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.DbManager;
import engine.gameManager.SessionManager;
import engine.math.Vector3fImmutable;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
import engine.util.MiscUtils;
public class ChangeNameCmd extends AbstractDevCmd {
public ChangeNameCmd() {
super("changename");
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
Vector3fImmutable loc = null;
// Arg Count Check
if (words.length < 2) {
this.sendUsage(pc);
return;
}
String oldFirst = words[0];
String newFirst = words[1];
String newLast = "";
if (words.length > 2) {
newLast = words[2];
for (int i = 3; i < words.length; i++)
newLast += ' ' + words[i];
}
//verify new name length
if (newFirst.length() < 3) {
this.throwbackError(pc, "Error: First name is incorrect length. Must be between 3 and 15 characters");
return;
}
//verify old name length
if (newLast.length() > 50) {
this.throwbackError(pc, "Error: Last name is incorrect length. Must be no more than 50 characters");
return;
}
// Check if firstname is valid
if (MiscUtils.checkIfFirstNameInvalid(newFirst)) {
this.throwbackError(pc, "Error: First name is not allowed");
return;
}
//get the world ID we're modifying for
//test if first name is unique, unless new and old first name are equal.
if (!(oldFirst.equals(newFirst))) {
if (!DbManager.PlayerCharacterQueries.IS_CHARACTER_NAME_UNIQUE(newFirst)) {
this.throwbackError(pc, "Error: First name is not unique.");
return;
}
}
//tests passed, update name in database
if (!DbManager.PlayerCharacterQueries.UPDATE_NAME(oldFirst, newFirst, newLast)) {
this.throwbackError(pc, "Error: Database failed to update the name.");
return;
}
//Finally update player ingame
PlayerCharacter pcTar = null;
try {
pcTar = SessionManager
.getPlayerCharacterByLowerCaseName(words[0]);
pcTar.setFirstName(newFirst);
pcTar.setLastName(newLast);
this.setTarget(pcTar); //for logging
//specify if last name is ascii characters only
String lastAscii = newLast.replaceAll("[^\\p{ASCII}]", "");
pcTar.setAsciiLastName(lastAscii.equals(newLast));
} catch (Exception e) {
this.throwbackError(pc, "Database was updated but ingame character failed to update.");
return;
}
String out = oldFirst + " was changed to " + newFirst + (newLast.isEmpty() ? "." : (' ' + newLast + '.'));
this.throwbackInfo(pc, out);
}
@Override
protected String _getHelpString() {
return "Changes the name of a player";
}
@Override
protected String _getUsageString() {
return "'./changename oldFirstName newFirstName newLastName'";
}
}
@@ -1,56 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.net.client.msg.TargetedActionMsg;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
/**
* @author Eighty
*/
public class CombatMessageCmd extends AbstractDevCmd {
public CombatMessageCmd() {
super("cm");
}
@Override
protected void _doCmd(PlayerCharacter pcSender, String[] args,
AbstractGameObject target) {
if (pcSender == null)
return;
if (args.length != 1) {
this.sendUsage(pcSender);
return;
}
int num = 0;
try {
num = Integer.parseInt(args[0]);
} catch (NumberFormatException e) {
throwbackError(pcSender, "Supplied message number " + args[0] + " failed to parse to an Integer");
return;
}
TargetedActionMsg.un2cnt = num;
throwbackInfo(pcSender, "CombatMessage set to " + num);
}
@Override
protected String _getUsageString() {
return "' /cm [cmNumber]'";
}
@Override
protected String _getHelpString() {
return "Sets the combat message to the supplied integer value";
}
}
+38 -18
View File
@@ -3,17 +3,21 @@
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022 // Magicbane Emulator Project © 2013 - 2026
// www.magicbane.com // https://www.magicbane.com
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager;
import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.ItemBase; import engine.objects.Item;
import engine.objects.ItemFactory; import engine.objects.ItemTemplate;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import org.pmw.tinylog.Logger;
/** /**
* @author Eighty * @author Eighty
@@ -25,30 +29,46 @@ public class CreateItemCmd extends AbstractDevCmd {
} }
@Override @Override
protected void _doCmd(PlayerCharacter pc, String[] words, protected void _doCmd(PlayerCharacter playerCharacter, String[] words,
AbstractGameObject target) { AbstractGameObject target) {
if (words.length < 2) { if (words.length < 2) {
this.sendUsage(pc); this.sendUsage(playerCharacter);
return;
}
int id;
id = ItemBase.getIDByName(words[0]);
if (id == 0)
id = Integer.parseInt(words[0]);
if (id == 7) {
this.throwbackInfo(pc, "use /addgold to add gold.....");
return; return;
} }
int templateID = Integer.parseInt(words[0]);
ItemTemplate template = ItemTemplate.templates.get(templateID);
if (template == null) {
ChatManager.chatSystemInfo(playerCharacter, "No such template found.");
return;
}
int size = 1; int size = 1;
if (words.length < 3) { if (words.length == 2)
size = Integer.parseInt(words[1]); size = Integer.parseInt(words[1]);
for (int i = 0; i < size; i++) {
if (!playerCharacter.charItemManager.hasRoomInventory(template.item_wt)) {
ChatManager.chatSystemInfo(playerCharacter, "You are encumbered!.");
break;
} }
ItemFactory.fillInventory(pc, id, size); Item item = new Item(templateID);
item.ownerID = playerCharacter.getObjectUUID();
item.ownerType = mbEnums.OwnerType.PlayerCharacter;
item.containerType = mbEnums.ItemContainerType.INVENTORY;
try {
item = DbManager.ItemQueries.PERSIST(item);
playerCharacter.charItemManager.addItemToInventory(item);
} catch (Exception e) {
Logger.error(e);
}
}
playerCharacter.charItemManager.updateInventory();
} }
@Override @Override
@@ -58,7 +78,7 @@ public class CreateItemCmd extends AbstractDevCmd {
@Override @Override
protected String _getUsageString() { protected String _getUsageString() {
return "' /createitem <ItembaseID> <quantity>'"; return "' /createitem <templateID> <quantity>'";
} }
} }
-122
View File
@@ -1,122 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.jobs.DebugTimerJob;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
public class DebugCmd extends AbstractDevCmd {
public DebugCmd() {
super("debug");
// super("debug", MBServerStatics.ACCESS_GROUP_ALL_TEAM, 0, false, false);
}
private static void toggleDebugTimer(PlayerCharacter pc, String name, int num, int duration, boolean toggle) {
if (toggle) {
DebugTimerJob dtj = new DebugTimerJob(pc, name, num, duration);
pc.renewTimer(name, dtj, duration);
} else
pc.cancelTimer(name);
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
if (words.length < 2) {
this.sendUsage(pc);
return;
}
if (pc == null)
return;
//pc.setDebug must use bit sizes: 1, 2, 4, 8, 16, 32
String command = words[0].toLowerCase();
boolean toggle = (words[1].toLowerCase().equals("on")) ? true : false;
switch (command) {
case "magictrek":
pc.RUN_MAGICTREK = toggle;
break;
case "combat":
pc.setDebug(64, toggle);
break;
case "health":
toggleDebugTimer(pc, "Debug_Health", 1, 1000, toggle);
break;
case "mana":
toggleDebugTimer(pc, "Debug_Mana", 2, 1000, toggle);
break;
case "stamina":
toggleDebugTimer(pc, "Debug_Stamina", 3, 500, toggle);
break;
case "spells":
pc.setDebug(16, toggle);
break;
case "damageabsorber":
pc.setDebug(2, toggle);
break;
case "recast":
case "recycle":
pc.setDebug(4, toggle);
break;
case "seeinvis":
pc.setDebug(8, toggle);
break;
case "movement":
pc.setDebug(1, toggle);
break;
case "noaggro":
pc.setDebug(32, toggle);
break;
// case "loot":
// MBServerStatics.debugLoot = toggle;
// break;
default:
String output = "Debug for " + command + " not found.";
throwbackError(pc, output);
return;
}
setTarget(pc); //for logging
String output = "Debug for " + command + " turned " + ((toggle) ? "on." : "off.");
throwbackInfo(pc, output);
}
@Override
protected String _getHelpString() {
return "Runs debug commands";
}
@Override
protected String _getUsageString() {
return "'./Debug command on/off'";
}
}
@@ -1,57 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
public class DebugMeleeSyncCmd extends AbstractDevCmd {
public DebugMeleeSyncCmd() {
super("debugmeleesync");
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
// Arg Count Check
if (words.length != 1) {
this.sendUsage(pc);
return;
}
String s = words[0].toLowerCase();
if (s.equals("on")) {
pc.setDebug(64, true);
ChatManager.chatSayInfo(pc, "Melee Sync Debug ON");
} else if (s.equals("off")) {
pc.setDebug(64, false);
ChatManager.chatSayInfo(pc, "Melee Sync Debug OFF");
} else {
this.sendUsage(pc);
}
}
@Override
protected String _getHelpString() {
return "Turns on/off melee sync debugging.";
}
@Override
protected String _getUsageString() {
return "'./debugmeleesync on|off'";
}
}
@@ -1,54 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.Enum;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.DbManager;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
/**
*
*/
public class DecachePlayerCmd extends AbstractDevCmd {
public DecachePlayerCmd() {
super("decacheplayer");
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
if (words.length < 1) {
this.sendUsage(pc);
}
int objectUUID = Integer.parseInt(words[0]);
if (DbManager.inCache(Enum.GameObjectType.PlayerCharacter, objectUUID)) {
this.setTarget(PlayerCharacter.getFromCache(objectUUID)); //for logging
PlayerCharacter.getFromCache(objectUUID).removeFromCache();
} else {
this.sendHelp(pc);
}
}
@Override
protected String _getHelpString() {
return "No player found. Please make sure the table ID is correct.";
}
@Override
protected String _getUsageString() {
return "' /decacheplayer <UUID>'";
}
}
-66
View File
@@ -1,66 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd;
import engine.objects.AbstractGameObject;
import engine.objects.Mob;
import engine.objects.PlayerCharacter;
public class DespawnCmd extends AbstractDevCmd {
public DespawnCmd() {
super("debugmob");
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
if (pc == null) {
return;
}
Mob mob = null;
if (target != null && target.getObjectType().equals(GameObjectType.Mob))
mob = (Mob) target;
if (mob == null)
mob = Mob.getFromCache(Integer.parseInt(words[1]));
if (mob == null)
return;
if (words[0].equalsIgnoreCase("respawn")) {
mob.respawn();
this.throwbackInfo(pc, "Mob with ID " + mob.getObjectUUID() + " Respawned");
} else if (words[0].equalsIgnoreCase("despawn")) {
mob.despawn();
this.throwbackInfo(pc, "Mob with ID " + mob.getObjectUUID() + " Despawned");
}
}
@Override
protected String _getHelpString() {
return "Gets distance from a target.";
}
@Override
protected String _getUsageString() {
return "' /distance'";
}
}
-65
View File
@@ -1,65 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.math.Vector3fImmutable;
import engine.objects.AbstractGameObject;
import engine.objects.AbstractWorldObject;
import engine.objects.PlayerCharacter;
public class DistanceCmd extends AbstractDevCmd {
public DistanceCmd() {
super("distance");
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
// Arg Count Check
if (words.length != 1) {
this.sendUsage(pc);
return;
}
if (pc == null) {
return;
}
if (target == null || !(target instanceof AbstractWorldObject)) {
throwbackError(pc, "No target found.");
return;
}
AbstractWorldObject awoTarget = (AbstractWorldObject) target;
Vector3fImmutable pcLoc = pc.getLoc();
Vector3fImmutable tarLoc = awoTarget.getLoc();
String out = "Distance: " + pcLoc.distance(tarLoc) +
"\r\nYour Loc: " + pcLoc.x + 'x' + pcLoc.y + 'x' + pcLoc.z +
"\r\nTarget Loc: " + tarLoc.x + 'x' + tarLoc.y + 'x' + tarLoc.z;
throwbackInfo(pc, out);
}
@Override
protected String _getHelpString() {
return "Gets distance from a target.";
}
@Override
protected String _getUsageString() {
return "' /distance'";
}
}
-61
View File
@@ -1,61 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager;
import engine.gameManager.PowersManager;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
import engine.powers.EffectsBase;
/**
* @author Eighty
*/
public class EffectCmd extends AbstractDevCmd {
public EffectCmd() {
super("effect");
}
@Override
protected void _doCmd(PlayerCharacter pcSender, String[] args,
AbstractGameObject target) {
int ID = 0;
int token = 0;
if (args.length != 2) {
this.sendUsage(pcSender);
return;
}
ID = Integer.parseInt(args[0]);
token = Integer.parseInt(args[1]);
EffectsBase eb = PowersManager.setEffectToken(ID, token);
if (eb == null) {
throwbackError(pcSender, "Unable to find EffectsBase " + ID
+ " to modify.");
return;
}
ChatManager.chatSayInfo(pcSender,
"EffectsBase with ID " + ID + " changed token to " + token);
}
@Override
protected String _getUsageString() {
return "' /effect EffectsBaseID Token'";
}
@Override
protected String _getHelpString() {
return "Temporarily places the effect token with the corresponding EffectsBase on the server";
}
}
-87
View File
@@ -1,87 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.objects.*;
public class EnchantCmd extends AbstractDevCmd {
public EnchantCmd() {
super("enchant");
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
int rank = 0;
if (words.length < 1) {
this.sendUsage(pc);
return;
}
try {
rank = Integer.parseInt(words[0]);
} catch (Exception e) {
}
Item item;
if (target == null || target instanceof Item)
item = (Item) target;
else {
throwbackError(pc, "Must have an item targeted");
return;
}
CharacterItemManager cim = pc.getCharItemManager();
if (cim == null) {
throwbackError(pc, "Unable to find the character item manager for player " + pc.getFirstName() + '.');
return;
}
if (words[0].equals("clear")) {
item.clearEnchantments();
cim.updateInventory();
this.setResult(String.valueOf(item.getObjectUUID()));
} else {
int cnt = words.length;
for (int i = 1; i < cnt; i++) {
String enchant = words[i];
boolean valid = true;
for (Effect eff : item.getEffects().values()) {
if (eff.getEffectsBase().getIDString().equals(enchant)) {
throwbackError(pc, "This item already has that enchantment");
return;
}
}
if (valid) {
item.addPermanentEnchantmentForDev(enchant, rank);
this.setResult(String.valueOf(item.getObjectUUID()));
} else
throwbackError(pc, "Invalid Enchantment. Enchantment must consist of SUF-001 to SUF-328 or PRE-001 to PRE-334. Sent " + enchant + '.');
}
cim.updateInventory();
}
}
@Override
protected String _getHelpString() {
return "Enchants an item with a prefix and suffix";
}
@Override
protected String _getUsageString() {
return "' /enchant clear/Enchant1 Enchant2 Enchant3 ...'";
}
}

Some files were not shown because too many files have changed in this diff Show More