mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-15 08:25:21 +01:00
More refactoring (player id -> player uid)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package emu.grasscutter.game;
|
||||
|
||||
import dev.morphia.annotations.AlsoLoad;
|
||||
import dev.morphia.annotations.Collation;
|
||||
import dev.morphia.annotations.Entity;
|
||||
import dev.morphia.annotations.Id;
|
||||
@@ -24,7 +25,7 @@ public class Account {
|
||||
private String username;
|
||||
private String password; // Unused for now
|
||||
|
||||
private int playerId;
|
||||
@AlsoLoad("playerUid") private int playerId;
|
||||
private String email;
|
||||
|
||||
private String token;
|
||||
@@ -68,7 +69,7 @@ public class Account {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public int getPlayerId() {
|
||||
public int getPlayerUid() {
|
||||
return this.playerId;
|
||||
}
|
||||
|
||||
|
||||
@@ -722,7 +722,7 @@ public class GenshinPlayer {
|
||||
// Make sure these exist
|
||||
if (this.getTeamManager() == null) {
|
||||
this.teamManager = new TeamManager(this);
|
||||
} if (this.getProfile().getId() == 0) {
|
||||
} if (this.getProfile().getUid() == 0) {
|
||||
this.getProfile().syncWithCharacter(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ public class FriendsList {
|
||||
friendship.setOwner(getPlayer());
|
||||
|
||||
// Check if friend is online
|
||||
GenshinPlayer friend = getPlayer().getSession().getServer().getPlayerByUid(friendship.getFriendProfile().getId());
|
||||
GenshinPlayer friend = getPlayer().getSession().getServer().getPlayerByUid(friendship.getFriendProfile().getUid());
|
||||
if (friend != null) {
|
||||
// Set friend to online mode
|
||||
friendship.setFriendProfile(friend);
|
||||
|
||||
@@ -88,7 +88,7 @@ public class Friendship {
|
||||
|
||||
public FriendBrief toProto() {
|
||||
FriendBrief proto = FriendBrief.newBuilder()
|
||||
.setUid(getFriendProfile().getId())
|
||||
.setUid(getFriendProfile().getUid())
|
||||
.setNickname(getFriendProfile().getName())
|
||||
.setLevel(getFriendProfile().getPlayerLevel())
|
||||
.setAvatar(HeadImage.newBuilder().setAvatarId(getFriendProfile().getAvatarId()))
|
||||
|
||||
@@ -7,7 +7,7 @@ import emu.grasscutter.utils.Utils;
|
||||
public class PlayerProfile {
|
||||
@Transient private GenshinPlayer player;
|
||||
|
||||
private int id;
|
||||
@AlsoLoad("id") private int uid;
|
||||
private int nameCard;
|
||||
private int avatarId;
|
||||
private String name;
|
||||
@@ -22,12 +22,12 @@ public class PlayerProfile {
|
||||
public PlayerProfile() { }
|
||||
|
||||
public PlayerProfile(GenshinPlayer player) {
|
||||
this.id = player.getUid();
|
||||
this.uid = player.getUid();
|
||||
this.syncWithCharacter(player);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public GenshinPlayer getPlayer() {
|
||||
@@ -87,7 +87,7 @@ public class PlayerProfile {
|
||||
return;
|
||||
}
|
||||
|
||||
this.id = player.getUid();
|
||||
this.uid = player.getUid();
|
||||
this.name = player.getNickname();
|
||||
this.avatarId = player.getHeadImage();
|
||||
this.signature = player.getSignature();
|
||||
|
||||
Reference in New Issue
Block a user