mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 17:05:20 +01:00
Refactor accounts to not use a player uid
This commit is contained in:
@@ -118,6 +118,7 @@ public final class GameServer extends KcpServer {
|
||||
public ChatManagerHandler getChatManager() {
|
||||
return chatManager;
|
||||
}
|
||||
|
||||
public void setChatManager(ChatManagerHandler chatManager) {
|
||||
this.chatManager = chatManager;
|
||||
}
|
||||
@@ -189,12 +190,17 @@ public final class GameServer extends KcpServer {
|
||||
|
||||
// Check database if character isnt here
|
||||
if (player == null) {
|
||||
player = DatabaseHelper.getPlayerById(id);
|
||||
player = DatabaseHelper.getPlayerByUid(id);
|
||||
}
|
||||
|
||||
return player;
|
||||
}
|
||||
|
||||
public Player getPlayerByAccountId(String accountId) {
|
||||
Optional<Player> playerOpt = getPlayers().values().stream().filter(player -> player.getAccount().getId().equals(accountId)).findFirst();
|
||||
return playerOpt.orElse(null);
|
||||
}
|
||||
|
||||
public SocialDetail.Builder getSocialDetailByUid(int id) {
|
||||
// Get from online players
|
||||
Player player = this.getPlayerByUid(id, true);
|
||||
|
||||
Reference in New Issue
Block a user