Commit Graph
100 Commits
Author SHA1 Message Date
P0nk 033d91ed71 Merge branch 'master' into feat/postgresql-database
# Conflicts:
#	config.yaml
#	src/main/java/config/ServerConfig.java
2023-11-08 21:21:07 +01:00
P0nk 0aee9d7c3f Fix unable to create playernpc
The initialization of the running world counters depended on worlds already having been initialized, so I made that dependency more explicit.
2023-09-19 12:56:51 +02:00
P0nk a49c1703ae Remove developer player npc 2023-09-18 23:26:37 +02:00
P0nk 392a350eab Merge branch 'master' into feat/postgresql-database
# Conflicts:
#	docker-compose.yml
2023-08-20 18:30:52 +02:00
P0nk f33df59f49 Move some Client#forceDisconnect calls to TransitionService 2023-08-11 22:00:33 +02:00
P0nk cd75e85bec Move some autoban logic to new BanService 2023-08-10 22:52:09 +02:00
P0nk cb31121fe7 Disconnect client with TransitionService 2023-08-10 21:58:55 +02:00
P0nk d5682a5f65 Add client disconnection logic to TransitionService
Problem: disconnecting requires access to CharacterSaver,
which is not available in Client.
Having it in a service like this solves that problem.

Next step is to migrate all calls to Client#disconnect and Client#forceDisconnect
to their TransitionService counterparts.
2023-08-08 21:51:12 +02:00
P0nk f6d06ba82a Extract "char list" from Client to handler 2023-08-06 21:14:32 +02:00
P0nk bbee8d7caa Merge chr name + id wrappers into new CharacterIdentity record 2023-08-06 20:35:26 +02:00
P0nk 5b5888cf65 Remove unused stuff in Client 2023-08-06 20:11:32 +02:00
P0nk 48d9aaa871 Clean up Client - visibleWorlds & canRequestCharlist
canRequestCharlist is a relic from the past when "View all char"
functionality was hacked together with wrong packets.

visibleWorlds I'm less sure about. I suppose it's useful if you add world
(via command) while someone is still on the login screen.
But the functionality of adding/removing worlds live is a recipe for disaster
and will eventually (likely) be removed.
2023-08-06 20:02:39 +02:00
P0nk f44083aeba Refactor Client#finishLogin 2023-08-06 17:26:34 +02:00
P0nk 810dbcc1d7 Remove "reward points" feature 2023-08-06 16:55:58 +02:00
P0nk 449ab01bc2 Remove "vote points" feature 2023-08-06 16:55:34 +02:00
P0nk 2686b2b02d Disconnect client by throwing exception in handler
This makes it easier to add checks in handlers, which should improve security over time.
I think this approach is more readable and testable than calling Client#disconnect straight up,
while it also decentralizes the handling.
2023-08-06 15:48:49 +02:00
P0nk e9819fac87 Save cooldowns and diseases as part of normal flow 2023-08-04 16:34:59 +02:00
P0nk 4e39142fb3 Direct almost all chr saving through CharacterSaver
Client#disconnectInternal remains.
Had to remove some configurable save points to keep it simple.
2023-08-04 16:14:51 +02:00
P0nk e52f646558 Fix batch insert monster cards
batch.add() clears all bindings, unlike vanilla JDBC
2023-08-04 15:38:14 +02:00
P0nk 02d4ff524a Fix global drops not dropping
No longer able to shuffle the list since DropProvider
return an unmodifiable list in the case of global drops.
2023-08-04 15:23:02 +02:00
P0nk 05b7ec77c8 Add ChannelService to handle cc'ing 2023-08-04 15:01:49 +02:00
P0nk f6aa8ceba6 Rewrite MonsterBook, touch up chr loading
Temporarily disabled loading monster cards from db
2023-07-25 21:27:35 +02:00
P0nk b3ec325e95 Add monster card table and initial dao 2023-07-25 18:46:03 +02:00
P0nk e31465a1b5 Add MonsterCard 2023-07-25 17:52:38 +02:00
P0nk 84ad5b4db8 Remove scroll generator (custom feature)
This allowed me to remove the getCardTierSize db query
2023-07-25 17:20:16 +02:00
P0nk 855b66c459 Merge branch 'master' into feat/postgresql-database 2023-07-25 17:03:35 +02:00
P0nk 46f767d79c Merge branch 'master' into feat/postgresql-database 2023-05-29 15:56:53 +02:00
P0nk 785f74ed21 Fix HelpCommand not working without static CommandsExecutor 2023-03-31 07:59:43 +02:00
P0nk 699da37f06 Simplify NPC script start 2023-03-31 07:33:49 +02:00
P0nk c3badba73b Convert ShopItem to record 2023-03-30 07:07:33 +02:00
P0nk 5f0e9a355b Move Shop stuff to own package 2023-03-30 06:47:07 +02:00
P0nk 39d759595d Get shop as Optional 2023-03-30 06:41:13 +02:00
P0nk fe9dd75a23 Instantiate shops in ShopFactory 2023-03-29 21:59:00 +02:00
P0nk 2139147dcd Add getShop to DAO, preparing to refactor shop loading 2023-03-29 21:14:19 +02:00
P0nk c71ca7f4d5 Inject ShopFactory 2023-03-29 20:51:31 +02:00
P0nk 705efb4340 Remove access to shops from scripts 2023-03-29 20:38:34 +02:00
P0nk ec1450cec1 Rewrite Mo NPC script to be GMS-like 2023-03-29 19:54:59 +02:00
P0nk 290bf78db3 Notes about difficulties of DI for scripts 2023-03-18 16:04:01 +01:00
P0nk 02c1fe46f3 Remove custom shops
These custom shops we introduced in HeavenMS.
2082014 - Asia selling scrolls
9201101 - T-1337 selling special potions
2023-03-18 15:14:00 +01:00
P0nk 7315dd80fc Remove redundant scripts for Ariant weapon & armor merchants 2023-03-18 15:08:06 +01:00
P0nk a496c0f2b4 Add ShopDao 2023-03-18 14:32:21 +01:00
P0nk ab0239ba84 Add shop and shop_item PG tables with data 2023-03-17 20:53:16 +01:00
P0nk f2f3abdb32 Move last pieces of monster drops to DropProvider 2023-03-16 18:55:33 +01:00
P0nk 5a35b55d7a Cache continent drops 2023-03-16 18:03:43 +01:00
P0nk 02aa4a237f Global monster drops are retrieved from DropProvider (postgres db) 2023-03-16 18:00:21 +01:00
P0nk cc88d382e6 Monster drops are retrieved from DropProvider (postgres db)
This commit emphasizes the need for events to be reworked.
This is the chain of constructors the DropProvider has to pass through to reach MapleMap:
Channel -> EventScriptManager -> EventManager -> EventInstanceManager -> MapManager -> MapleMap
2023-03-16 08:31:38 +01:00
P0nk a95fa2efc1 Refactor LootInventory & LootManager 2023-03-16 00:25:21 +01:00
P0nk 45e2b93724 Remove "multiple same equip drop" feature 2023-03-15 23:26:15 +01:00
P0nk fa3481fa99 Pass CommandContext to commands
CommandContext is the carrier of dependencies.
Currently, it only carries a DropProvider, but
it will grow bit by bit as more static singletons
and other similar structures get refactored.
2023-03-15 23:19:04 +01:00
P0nk eed94ec34a Refactor CommandsExecutor - is no longer static singleton
Preparing for change in Command#handle,
which is going to take a CommandContext as an additional argument.
This way we can pass in command dependencies in a safe way
instead of requiring them to access static methods.
2023-03-15 22:56:40 +01:00
P0nk a6a7a26ebc Clean up Steal stuff in MIP 2023-03-15 22:41:36 +01:00
P0nk 7ed7b25268 Fix race condition when concurrently Stealing 2023-03-15 22:38:54 +01:00
P0nk 703ae30a27 Move "steal item" logic to DropProvider 2023-03-15 22:22:14 +01:00
P0nk 6bf8785f22 Fix error in monster_drop query 2023-03-15 22:17:42 +01:00
P0nk 53768555a2 Add table, data, and provider method for global drops 2023-03-09 20:08:20 +01:00
P0nk a70f4e303d Add DropProvider and dao for monster drops 2023-03-08 22:46:24 +01:00
P0nk 7a848cf6a1 Add monster_drop table with data 2023-03-08 22:31:14 +01:00
P0nk 0be48568d7 Get MakerItemCreateEntry from new info provider 2023-03-08 21:09:47 +01:00
P0nk 1fd0963401 Fix maker disassembly fee not being applied 2023-03-04 22:53:05 +01:00
P0nk d2d4b442d2 Maker disassembly info to MakerInfoProvider
MakerProcessor is such a mess...
2023-03-04 22:33:34 +01:00
P0nk 9d6574d3ba Cache maker info with Caffeine 2023-03-04 21:27:18 +01:00
P0nk f2ca67aba4 Add tests for MakerInfoProvider
These are going to be handy soon,
as I'm about to add Caffeine for caching.
2023-03-04 21:02:04 +01:00
P0nk 6073b20d65 Cache MakerRecipe, move stimulant to MakerInfoProvider 2023-03-04 17:20:16 +01:00
P0nk b329709776 Expose containerized databases to host
This way you can connect with your favorite db client
2023-03-04 16:04:18 +01:00
P0nk 932f9fc443 Merge branch 'master' into feat/postgresql-database
# Conflicts:
#	pom.xml
2023-03-02 18:40:27 +01:00
P0nk f4062e5ebb Upgrade dependencies 2023-03-02 18:31:21 +01:00
P0nk 10945927c1 Fix writeString not fully respecting charset
The string would be cut short for charsets
with characters more than 1 byte.
2023-03-02 18:11:41 +01:00
P0nk c0c0a2d2d9 Get maker reagent from PG db, rework processor (no statics) 2023-03-02 08:18:13 +01:00
P0nk 5cecb7adb6 Add maker_random_reward table and data (formerly "makerrewarddata") 2023-03-01 21:09:32 +01:00
P0nk 26357a8d7b Add maker_reagent table and data (formerly "makerreagentdata") 2023-03-01 20:51:26 +01:00
P0nk 9819fd5bb1 Add maker_recipe_ingredient table and data (formerly "makerrecipedata") 2023-03-01 20:45:51 +01:00
P0nk adbdb89917 Add maker_recipe table and data (formerly "makercreatedata") 2023-03-01 20:34:48 +01:00
P0nk b7c79800eb Fix note not showing if case mismatch in name
This wouldn't be a problem in the first case,
if there was a foreign key connection between
note and character tables.
Can't add that quite yet though.
2023-02-28 21:30:20 +01:00
P0nk 55e1f65bbd Fix server not able to use note sequence 2023-02-27 19:55:01 +01:00
P0nk d018b0f5e5 Add note receiver index
Only makes a difference if there is
a large amount of notes in the database.
Better be safe than sorry.
2023-02-27 18:16:23 +01:00
P0nk 12745c207d Move notes to the Postgres database 2023-02-25 00:40:36 +01:00
P0nk f6f3c9c3e3 Initiate Postgres connection pool on startup 2023-02-25 00:11:33 +01:00
P0nk 8bb825ef02 Add Docker compose support for Postgres 2023-02-24 23:42:13 +01:00
P0nk f1192279bf Add Flyway, run db migration in local PostgreSQL db
First step in my plan to switch away from MySQL.
2023-02-24 21:49:00 +01:00
P0nk b30e03ffb3 Fix portal in Zenumist society not working for GM chr 2023-02-17 00:42:33 +01:00
P0nk 82157c7bd1 Flatten ChangeMapHandler 2023-02-16 23:46:13 +01:00
P0nk b1ef94ef60 Fix handbook file encoding
All handbook files are now UTF-8
2023-02-04 19:49:54 +01:00
P0nk f89392b476 Refactor IdCommand 2023-02-04 19:46:09 +01:00
P0nk 404c00c2bf Merge branch 'master' into feat/note-dao 2022-12-27 15:09:38 +01:00
P0nk 771b69d151 Merge branch 'master' into feat/note-dao 2022-12-27 14:21:43 +01:00
P0nk 14d80dc2f3 Fix saving "Illegal program claim" report
No chatlog is provided in the packet for this type
2022-12-27 14:08:20 +01:00
P0nk cb38bcd270 Fix wrong timestamp format when saving report 2022-12-27 14:08:20 +01:00
P0nk 37a9a4121f Show confirmation after note is sent 2022-12-27 12:31:47 +01:00
P0nk 4731c0c60d Add tests for NoteService 2022-12-27 12:18:58 +01:00
P0nk 65111ae209 Create packet class for PacketCreator::showNotes 2022-12-27 12:18:36 +01:00
P0nk 2a460de911 Disable logging in tests 2022-12-27 12:05:51 +01:00
P0nk cee82a08ba Remove ItemInformationProvider field in Character
This field prevented creation of Character mock in tests
2022-12-27 11:59:14 +01:00
P0nk 387437cada Workaround for Guild dependence on NoteDao 2022-12-27 11:05:00 +01:00
P0nk af14da987e Replace FredrickProcessor dependence on NoteDao 2022-12-27 11:04:11 +01:00
P0nk 389b3ad2a4 Add NoteService to handle note operations
NoteService should be the only class with access to NoteDao;
nowhere else should NoteDao be accessed directly.

Channel dependencies are static in PacketProcessor, for now.
Ideally they would be injected in the constructor,
but since the constructor is private and I don't want to open
up that can of worms, I'll leave it like this.
At the very least, now we have a way of injecting services into
the handlers. This will make further restructuring way easier.
2022-12-27 10:34:55 +01:00
P0nk 5f1f5b7dcd Fix saving note 2022-12-27 10:24:47 +01:00
P0nk 7e3be4c45d Update README - explain hide 2022-12-26 18:09:09 +01:00
P0nk c82881e6f2 Get rid of Character#sendNote, refactor usages of it 2022-12-26 18:09:09 +01:00
P0nk 6be1fabc55 Send wedding invitation note directly via dao 2022-12-26 18:07:41 +01:00
P0nk 4d480660b5 Rework sending notes to chr, get rid of the first method
Sending notes should not be the handled by Character
2022-12-26 18:07:41 +01:00