RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
PlayerSerializer.java
1
package
com.osroyale.game.world.entity.mob.player.persist;
2
3
import
com.osroyale.Config;
4
import
com.osroyale.game.world.entity.mob.player.Player;
5
import
com.osroyale.net.codec.login.LoginResponse;
6
30
31
public
final
class
PlayerSerializer
{
32
33
private
static
final
PlayerPersistable perstable =
Config.FORUM_INTEGRATION
34
?
new
PlayerPersistDB
()
35
:
new
PlayerPersistFile
();
36
37
public
static
void
save(
Player
player) {
38
if
(player.isBot) {
39
return
;
40
}
41
42
// player save thread
43
Thread.startVirtualThread(() -> {
44
try
{
45
perstable.save(player);
46
}
catch
(
final
Exception e) {
47
e.printStackTrace();
48
}
49
});
50
}
51
52
public
static
LoginResponse
load(
Player
player, String expectedPassword) {
53
if
(player.isBot) {
54
return
LoginResponse
.COULD_NOT_COMPLETE_LOGIN;
55
}
56
57
return
perstable.load(player, expectedPassword);
58
}
59
}
com.osroyale.Config.FORUM_INTEGRATION
static final boolean FORUM_INTEGRATION
Definition
Config.java:158
com.osroyale.game.world.entity.mob.player.Player
Definition
Player.java:162
com.osroyale.game.world.entity.mob.player.persist.PlayerPersistDB
Definition
PlayerPersistDB.java:87
com.osroyale.game.world.entity.mob.player.persist.PlayerPersistFile
Definition
PlayerPersistFile.java:92
com.osroyale.game.world.entity.mob.player.persist.PlayerSerializer
Definition
PlayerSerializer.java:31
com.osroyale.net.codec.login.LoginResponse
Definition
LoginResponse.java:42