diff --git a/proto/HeadImage.proto b/proto/HeadImage.proto deleted file mode 100755 index 0aa6d697b..000000000 --- a/proto/HeadImage.proto +++ /dev/null @@ -1,7 +0,0 @@ -syntax = "proto3"; - -option java_package = "emu.grasscutter.net.proto"; - -message HeadImage { - uint32 avatarId = 1; -} diff --git a/src/main/java/emu/grasscutter/game/friends/Friendship.java b/src/main/java/emu/grasscutter/game/friends/Friendship.java index ef0bed109..79439bb3a 100644 --- a/src/main/java/emu/grasscutter/game/friends/Friendship.java +++ b/src/main/java/emu/grasscutter/game/friends/Friendship.java @@ -8,7 +8,7 @@ import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief; import emu.grasscutter.net.proto.FriendOnlineStateOuterClass.FriendOnlineState; -import emu.grasscutter.net.proto.HeadImageOuterClass.HeadImage; +import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture; @Entity(value = "friendships", useDiscriminator = false) public class Friendship { @@ -92,7 +92,7 @@ public class Friendship { .setUid(getFriendProfile().getUid()) .setNickname(getFriendProfile().getName()) .setLevel(getFriendProfile().getPlayerLevel()) - .setAvatarId(HeadImage.newBuilder().setAvatarId(getFriendProfile().getAvatarId()).getAvatarId()) + .setProfilePicture(ProfilePicture.newBuilder().setAvatarId(getFriendProfile().getAvatarId())) .setWorldLevel(getFriendProfile().getWorldLevel()) .setSignature(getFriendProfile().getSignature()) .setOnlineState(getFriendProfile().isOnline() ? FriendOnlineState.FRIEND_ONLINE : FriendOnlineState.FREIEND_DISCONNECT) diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index b4a22328d..2715ba6e6 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -27,13 +27,13 @@ import emu.grasscutter.game.world.World; import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.net.proto.AbilityInvokeEntryOuterClass.AbilityInvokeEntry; import emu.grasscutter.net.proto.CombatInvokeEntryOuterClass.CombatInvokeEntry; -import emu.grasscutter.net.proto.HeadImageOuterClass.HeadImage; import emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType; import emu.grasscutter.net.proto.MpSettingTypeOuterClass.MpSettingType; import emu.grasscutter.net.proto.OnlinePlayerInfoOuterClass.OnlinePlayerInfo; import emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass; import emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo; import emu.grasscutter.net.proto.PlayerWorldLocationInfoOuterClass; +import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture; import emu.grasscutter.net.proto.SocialDetailOuterClass.SocialDetail; import emu.grasscutter.server.game.GameServer; import emu.grasscutter.server.game.GameSession; @@ -799,7 +799,7 @@ public class Player { .setMpSettingType(this.getMpSetting()) .setNameCardId(this.getNameCardId()) .setSignature(this.getSignature()) - .setAvatarId(HeadImage.newBuilder().setAvatarId(this.getHeadImage()).getAvatarId()); + .setProfilePicture(ProfilePicture.newBuilder().setAvatarId(this.getHeadImage())); if (this.getWorld() != null) { onlineInfo.setCurPlayerNumInWorld(this.getWorld().getPlayers().indexOf(this) + 1); @@ -834,7 +834,7 @@ public class Player { public SocialDetail.Builder getSocialDetail() { SocialDetail.Builder social = SocialDetail.newBuilder() .setUid(this.getUid()) - .setAvatarId(HeadImage.newBuilder().setAvatarId(this.getHeadImage()).getAvatarId()) + .setProfilePicture(ProfilePicture.newBuilder().setAvatarId(this.getHeadImage())) .setNickname(this.getNickname()) .setSignature(this.getSignature()) .setLevel(this.getLevel()) diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java index b2628e36d..dbaa4b316 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java @@ -8,7 +8,7 @@ import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief; import emu.grasscutter.net.proto.FriendOnlineStateOuterClass.FriendOnlineState; import emu.grasscutter.net.proto.GetPlayerFriendListRspOuterClass.GetPlayerFriendListRsp; -import emu.grasscutter.net.proto.HeadImageOuterClass.HeadImage; +import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture; import emu.grasscutter.net.proto.PlatformTypeOuterClass; public class PacketGetPlayerFriendListRsp extends BasePacket { @@ -20,7 +20,7 @@ public class PacketGetPlayerFriendListRsp extends BasePacket { .setUid(GameConstants.SERVER_CONSOLE_UID) .setNickname("Server") .setLevel(1) - .setAvatarId(HeadImage.newBuilder().setAvatarId(GameConstants.MAIN_CHARACTER_FEMALE).getAvatarId()) + .setProfilePicture(ProfilePicture.newBuilder().setAvatarId(GameConstants.MAIN_CHARACTER_FEMALE)) .setWorldLevel(0) .setSignature("") .setLastActiveTime((int) (System.currentTimeMillis() / 1000f)) diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketSetPlayerHeadImageRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketSetPlayerHeadImageRsp.java index 9b736dc3e..4cbfd4b46 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketSetPlayerHeadImageRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketSetPlayerHeadImageRsp.java @@ -3,7 +3,7 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.net.packet.PacketOpcodes; -import emu.grasscutter.net.proto.HeadImageOuterClass.HeadImage; +import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture; import emu.grasscutter.net.proto.SetPlayerHeadImageRspOuterClass.SetPlayerHeadImageRsp; public class PacketSetPlayerHeadImageRsp extends BasePacket { @@ -12,7 +12,7 @@ public class PacketSetPlayerHeadImageRsp extends BasePacket { super(PacketOpcodes.SetPlayerHeadImageRsp); SetPlayerHeadImageRsp proto = SetPlayerHeadImageRsp.newBuilder() - .setAvatarId(HeadImage.newBuilder().setAvatarId(player.getHeadImage()).getAvatarId()) + .setProfilePicture(ProfilePicture.newBuilder().setAvatarId(player.getHeadImage())) .build(); this.setData(proto);