Commit Graph

36 Commits

Author SHA1 Message Date
P0nk
2b6ef9feb5 Save client addresses async on chr select
Almost rid of all db queries in Client
2024-10-03 08:28:55 +02:00
P0nk
e38344ceae Refactor BanService#ban 2024-10-02 06:54:55 +02:00
P0nk
5d81e05458 Redo mac bans - reduce amount of db queries on login
Works just like ip and hwid bans in that they are loaded on startup
2024-10-01 22:12:24 +02:00
P0nk
af02f8b744 Redo hwid bans - reduce amount of db queries on login
Works by loading all hwid bans on startup and querying the collection in memory
rather than making calls on every login.
2024-10-01 07:04:25 +02:00
P0nk
7661cd0f75 Redo ip bans - reduce amount of db queries on login
Works by loading all ip bans on startup and querying the collection in memory
rather than making calls on every login.
2024-09-30 19:31:21 +02:00
P0nk
e35060da2a Handle ban solely through BanService 2024-09-29 20:25:11 +02:00
P0nk
c0ee1f8ffe Encapsulate account creation in AccountService 2024-09-29 19:33:20 +02:00
P0nk
99006c2dda Set ban through AccountService 2024-09-29 19:30:24 +02:00
P0nk
b45620154c LoginState enum 2024-09-29 16:22:32 +02:00
P0nk
5450c29178 Reduce login state updates, fix multi-login on same acc 2024-09-29 15:55:25 +02:00
P0nk
902f1a154e Log out in PG on exit game
Can nog log in, enter game, exit game and re-login successfully.
2024-09-29 09:26:55 +02:00
P0nk
4e1aa1eb1a Rename NOT_LOGGED_IN -> LOGGED_OUT 2024-09-29 09:15:01 +02:00
P0nk
a580e44bc9 Rename AccountService methods 2024-09-29 09:14:32 +02:00
P0nk
da4a467453 Set in transition on log in, now able to enter the game
The state is not set properly on logout though, so once you log out you can't log back in
2024-09-29 08:22:26 +02:00
P0nk
0bb14e415e Log in through AccountService on player login 2024-09-29 07:52:42 +02:00
P0nk
5595f5763b Log in through AccountService 2024-09-28 18:30:41 +02:00
P0nk
55c9d4abbb Log out through AccountService 2024-09-28 18:26:23 +02:00
P0nk
93bbe868cb Use LoginState everywhere 2024-09-28 07:02:05 +02:00
P0nk
439280947c Save gender to PG 2024-09-27 23:20:02 +02:00
P0nk
5abae50be5 Rework login, get account from PG 2024-09-27 22:52:12 +02:00
P0nk
082e0c0486 Save chr slots to PG 2024-09-27 17:59:26 +02:00
P0nk
2044166967 Save pic to PG 2024-09-27 17:34:36 +02:00
P0nk
f33d4fbc1c Save pin to PG 2024-09-27 06:50:07 +02:00
P0nk
0f2ef341ce Save accepted ToS to PG 2024-09-26 21:14:52 +02:00
P0nk
647e67f6e8 Auto-create account in both MySQL and PG 2024-09-26 07:59:27 +02:00
P0nk
08eeeb54dc Rename ...Dao -> ...Repository 2024-09-14 12:06:09 +02:00
P0nk
758347f7bc Small refactor of disconnectInternal for readability 2024-09-13 23:23:35 +02:00
P0nk
f41268cdde Handle disconnect solely in TransitionService 2024-09-13 22:59:55 +02:00
P0nk
559fe2d550 Merge branch 'refs/heads/master' into feat/postgresql-database
# Conflicts:
#	config.yaml
#	docker-compose.yml
#	pom.xml
#	src/main/java/client/Character.java
#	src/main/java/client/Client.java
#	src/main/java/client/MonsterBook.java
#	src/main/java/client/command/commands/gm0/BuyBackCommand.java
#	src/main/java/client/processor/stat/AssignAPProcessor.java
#	src/main/java/config/ServerConfig.java
#	src/main/java/net/server/channel/Channel.java
#	src/main/java/net/server/channel/handlers/AbstractDealDamageHandler.java
#	src/main/java/net/server/channel/handlers/BuddylistModifyHandler.java
#	src/main/java/net/server/channel/handlers/CloseRangeDamageHandler.java
#	src/main/java/net/server/channel/handlers/EnterMTSHandler.java
#	src/main/java/net/server/channel/handlers/NPCTalkHandler.java
#	src/main/java/net/server/channel/handlers/RangedAttackHandler.java
#	src/main/java/net/server/channel/handlers/SummonDamageHandler.java
#	src/main/java/net/server/channel/handlers/UseCashItemHandler.java
#	src/main/java/net/server/handlers/login/CreateCharHandler.java
#	src/main/java/net/server/world/World.java
#	src/main/java/scripting/npc/NPCConversationManager.java
#	src/main/java/server/ItemInformationProvider.java
#	src/main/java/server/life/Monster.java
#	src/main/java/server/life/MonsterInformationProvider.java
#	src/main/java/server/maps/MapleMap.java
#	src/main/java/tools/PacketCreator.java
#	src/test/java/service/NoteServiceTest.java
#	src/test/java/testutil/Any.java
2024-09-02 20:43:55 +02:00
P0nk
cd75e85bec Move some autoban logic to new BanService 2023-08-10 22:52:09 +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
05b7ec77c8 Add ChannelService to handle cc'ing 2023-08-04 15:01:49 +02:00
P0nk
37a9a4121f Show confirmation after note is sent 2022-12-27 12:31:47 +01:00
P0nk
65111ae209 Create packet class for PacketCreator::showNotes 2022-12-27 12:18:36 +01:00
P0nk
387437cada Workaround for Guild dependence on NoteDao 2022-12-27 11:05:00 +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