RuneHive-Game
Loading...
Searching...
No Matches
PlayerSerializer.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.mob.player.persist;
2
3import com.runehive.Config;
4import com.runehive.game.world.entity.mob.player.Player;
5import com.runehive.net.codec.login.LoginResponse;
6
7public final class PlayerSerializer {
8
10 ? new PlayerPersistDB()
11 : new PlayerPersistFile();
12
13 public static void save(Player player) {
14 if (player.isBot) {
15 return;
16 }
17
18 // player save thread
19 Thread.startVirtualThread(() -> {
20 try {
21 perstable.save(player);
22 } catch (final Exception e) {
23 e.printStackTrace();
24 }
25 });
26 }
27
28 public static LoginResponse load(Player player, String expectedPassword) {
29 if (player.isBot) {
31 }
32
33 return perstable.load(player, expectedPassword);
34 }
35}
static final boolean FORUM_INTEGRATION
If forum integration is true, users can only login if they enter the same username and password that'...
Definition Config.java:117
This class represents a character controlled by a player.
Definition Player.java:125
static LoginResponse load(Player player, String expectedPassword)
Represents the enumerated login response codes.