mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-12 13:24:36 +01:00
Update friend list info packet
This commit is contained in:
@@ -47,7 +47,6 @@ import emu.lunarcore.game.scene.Scene;
|
||||
import emu.lunarcore.game.scene.SceneBuff;
|
||||
import emu.lunarcore.game.scene.entity.EntityProp;
|
||||
import emu.lunarcore.game.scene.entity.GameEntity;
|
||||
import emu.lunarcore.proto.AssistSimpleInfoOuterClass.AssistSimpleInfo;
|
||||
import emu.lunarcore.proto.BoardDataSyncOuterClass.BoardDataSync;
|
||||
import emu.lunarcore.proto.FriendOnlineStatusOuterClass.FriendOnlineStatus;
|
||||
import emu.lunarcore.proto.HeadIconOuterClass.HeadIcon;
|
||||
@@ -950,7 +949,6 @@ public class Player implements Tickable {
|
||||
.setOnlineStatus(this.isOnline() ? FriendOnlineStatus.FRIEND_ONLINE_STATUS_ONLINE : FriendOnlineStatus.FRIEND_ONLINE_STATUS_OFFLINE)
|
||||
.setPlatformType(PlatformType.PC)
|
||||
.setLastActiveTime(this.getLastActiveTime())
|
||||
.addAssistSimpleInfo(AssistSimpleInfo.newInstance().setAvatarId(GameConstants.TRAILBLAZER_AVATAR_ID).setLevel(1)) // TODO
|
||||
.setHeadIcon(this.getHeadIcon());
|
||||
|
||||
return proto;
|
||||
|
||||
@@ -8,6 +8,7 @@ import emu.lunarcore.proto.FriendListInfoOuterClass.FriendListInfo;
|
||||
import emu.lunarcore.proto.FriendOnlineStatusOuterClass.FriendOnlineStatus;
|
||||
import emu.lunarcore.proto.GetFriendListInfoScRspOuterClass.GetFriendListInfoScRsp;
|
||||
import emu.lunarcore.proto.PlatformTypeOuterClass.PlatformType;
|
||||
import emu.lunarcore.proto.PlayingStateOuterClass.PlayingState;
|
||||
import emu.lunarcore.proto.SimpleInfoOuterClass.SimpleInfo;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
@@ -39,9 +40,21 @@ public class PacketGetFriendListInfoScRsp extends BasePacket {
|
||||
var friend = friendList.getServer().getPlayerByUid(friendship.getFriendUid(), true);
|
||||
if (friend == null) continue;
|
||||
|
||||
// Create friend info
|
||||
var friendInfo = FriendListInfo.newInstance()
|
||||
.setSimpleInfo(friend.toSimpleInfo());
|
||||
|
||||
// Set playing state
|
||||
if (friend.isOnline()) {
|
||||
if (friend.getChallengeInstance() != null && friend.getChallengeInstance().isStory()) {
|
||||
friendInfo.setPlayingState(PlayingState.PLAYING_CHALLENGE_STORY);
|
||||
} else if (friend.getChallengeInstance() != null) {
|
||||
friendInfo.setPlayingState(PlayingState.PLAYING_CHALLENGE_MEMORY);
|
||||
} else if (friend.getRogueInstance() != null) {
|
||||
friendInfo.setPlayingState(PlayingState.PLAYING_ROGUE_COSMOS);
|
||||
}
|
||||
}
|
||||
|
||||
data.addFriendList(friendInfo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user