Commit 06a50365 authored by Melledy's avatar Melledy
Browse files

Merge branch 'dev-scene'

parents 2d2013df d9fc1595
...@@ -15,7 +15,7 @@ public class HandlerGetPlayerSocialDetailReq extends PacketHandler { ...@@ -15,7 +15,7 @@ public class HandlerGetPlayerSocialDetailReq extends PacketHandler {
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
GetPlayerSocialDetailReq req = GetPlayerSocialDetailReq.parseFrom(payload); GetPlayerSocialDetailReq req = GetPlayerSocialDetailReq.parseFrom(payload);
SocialDetail.Builder detail = session.getServer().getSocialDetailById(req.getUid()); SocialDetail.Builder detail = session.getServer().getSocialDetailByUid(req.getUid());
if (detail != null) { if (detail != null) {
detail.setIsFriend(session.getPlayer().getFriendsList().isFriendsWith(req.getUid())); detail.setIsFriend(session.getPlayer().getFriendsList().isFriendsWith(req.getUid()));
......
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.game.World;
import emu.grasscutter.game.props.EnterReason;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType;
import emu.grasscutter.net.proto.MarkMapReqOuterClass.MarkMapReq; import emu.grasscutter.net.proto.MarkMapReqOuterClass.MarkMapReq;
import emu.grasscutter.net.proto.OperationOuterClass.Operation; import emu.grasscutter.net.proto.OperationOuterClass.Operation;
import emu.grasscutter.net.packet.PacketHandler; import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketPlayerEnterSceneNotify;
import emu.grasscutter.server.packet.send.PacketSceneEntityAppearNotify; import emu.grasscutter.server.packet.send.PacketSceneEntityAppearNotify;
@Opcodes(PacketOpcodes.MarkMapReq) @Opcodes(PacketOpcodes.MarkMapReq)
...@@ -24,9 +28,13 @@ public class HandlerMarkMapReq extends PacketHandler { ...@@ -24,9 +28,13 @@ public class HandlerMarkMapReq extends PacketHandler {
session.getPlayer().getPos().setZ(req.getMark().getPos().getZ()); session.getPlayer().getPos().setZ(req.getMark().getPos().getZ());
session.getPlayer().getPos().setY(300); session.getPlayer().getPos().setY(300);
Grasscutter.getLogger().info("Player [" + session.getPlayer().getId() + ":" + session.getPlayer().getNickname() + "] tp to " + session.getPlayer().getPos()); Grasscutter.getLogger().info("Player [" + session.getPlayer().getUid() + ":" + session.getPlayer().getNickname() + "] tp to " + session.getPlayer().getPos() + " Scene id: " + req.getMark().getSceneId());
session.getPlayer().getWorld().broadcastPacket(new PacketSceneEntityAppearNotify(session.getPlayer())); if (req.getMark().getSceneId() != session.getPlayer().getSceneId()) {
session.getPlayer().getWorld().transferPlayerToScene(session.getPlayer(), req.getMark().getSceneId(), session.getPlayer().getPos());
} else {
session.getPlayer().getScene().broadcastPacket(new PacketSceneEntityAppearNotify(session.getPlayer()));
}
} }
} }
...@@ -14,6 +14,7 @@ import emu.grasscutter.server.packet.send.PacketSceneInitFinishRsp; ...@@ -14,6 +14,7 @@ import emu.grasscutter.server.packet.send.PacketSceneInitFinishRsp;
import emu.grasscutter.server.packet.send.PacketScenePlayerInfoNotify; import emu.grasscutter.server.packet.send.PacketScenePlayerInfoNotify;
import emu.grasscutter.server.packet.send.PacketSceneTeamUpdateNotify; import emu.grasscutter.server.packet.send.PacketSceneTeamUpdateNotify;
import emu.grasscutter.server.packet.send.PacketSceneTimeNotify; import emu.grasscutter.server.packet.send.PacketSceneTimeNotify;
import emu.grasscutter.server.packet.send.PacketSceneUnlockInfoNotify;
import emu.grasscutter.server.packet.send.PacketServerTimeNotify; import emu.grasscutter.server.packet.send.PacketServerTimeNotify;
import emu.grasscutter.server.packet.send.PacketSyncScenePlayTeamEntityNotify; import emu.grasscutter.server.packet.send.PacketSyncScenePlayTeamEntityNotify;
import emu.grasscutter.server.packet.send.PacketSyncTeamEntityNotify; import emu.grasscutter.server.packet.send.PacketSyncTeamEntityNotify;
...@@ -29,13 +30,14 @@ public class HandlerSceneInitFinishReq extends PacketHandler { ...@@ -29,13 +30,14 @@ public class HandlerSceneInitFinishReq extends PacketHandler {
session.send(new PacketServerTimeNotify()); session.send(new PacketServerTimeNotify());
session.send(new PacketWorldPlayerInfoNotify(session.getPlayer().getWorld())); session.send(new PacketWorldPlayerInfoNotify(session.getPlayer().getWorld()));
session.send(new PacketWorldDataNotify(session.getPlayer().getWorld())); session.send(new PacketWorldDataNotify(session.getPlayer().getWorld()));
session.send(new PacketSceneUnlockInfoNotify());
session.send(new GenshinPacket(PacketOpcodes.SceneForceUnlockNotify)); session.send(new GenshinPacket(PacketOpcodes.SceneForceUnlockNotify));
session.send(new PacketHostPlayerNotify(session.getPlayer().getWorld())); session.send(new PacketHostPlayerNotify(session.getPlayer().getWorld()));
session.send(new PacketSceneTimeNotify(session.getPlayer())); session.send(new PacketSceneTimeNotify(session.getPlayer()));
session.send(new PacketPlayerGameTimeNotify(session.getPlayer().getWorld(), session.getPlayer())); session.send(new PacketPlayerGameTimeNotify(session.getPlayer()));
session.send(new PacketPlayerEnterSceneInfoNotify(session.getPlayer())); session.send(new PacketPlayerEnterSceneInfoNotify(session.getPlayer()));
session.send(new PacketSceneAreaWeatherNotify(session.getPlayer().getWorld(), session.getPlayer())); session.send(new PacketSceneAreaWeatherNotify(session.getPlayer()));
session.send(new PacketScenePlayerInfoNotify(session.getPlayer().getWorld())); session.send(new PacketScenePlayerInfoNotify(session.getPlayer().getWorld()));
session.send(new PacketSceneTeamUpdateNotify(session.getPlayer())); session.send(new PacketSceneTeamUpdateNotify(session.getPlayer()));
......
...@@ -57,7 +57,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler { ...@@ -57,7 +57,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
} }
// Save account // Save account
session.getAccount().setPlayerId(player.getId()); session.getAccount().setPlayerId(player.getUid());
session.getAccount().save(); session.getAccount().save();
// Set character // Set character
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.World; import emu.grasscutter.game.World;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
...@@ -7,11 +8,11 @@ import emu.grasscutter.net.proto.ChangeGameTimeRspOuterClass.ChangeGameTimeRsp; ...@@ -7,11 +8,11 @@ import emu.grasscutter.net.proto.ChangeGameTimeRspOuterClass.ChangeGameTimeRsp;
public class PacketChangeGameTimeRsp extends GenshinPacket { public class PacketChangeGameTimeRsp extends GenshinPacket {
public PacketChangeGameTimeRsp(World world) { public PacketChangeGameTimeRsp(GenshinPlayer player) {
super(PacketOpcodes.ChangeGameTimeRsp); super(PacketOpcodes.ChangeGameTimeRsp);
ChangeGameTimeRsp proto = ChangeGameTimeRsp.newBuilder() ChangeGameTimeRsp proto = ChangeGameTimeRsp.newBuilder()
.setCurGameTime(world.getTime()) .setCurGameTime(player.getScene().getTime())
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -14,7 +14,7 @@ public class PacketGetPlayerAskFriendListRsp extends GenshinPacket { ...@@ -14,7 +14,7 @@ public class PacketGetPlayerAskFriendListRsp extends GenshinPacket {
GetPlayerAskFriendListRsp.Builder proto = GetPlayerAskFriendListRsp.newBuilder(); GetPlayerAskFriendListRsp.Builder proto = GetPlayerAskFriendListRsp.newBuilder();
for (Friendship friendship : player.getFriendsList().getPendingFriends().values()) { for (Friendship friendship : player.getFriendsList().getPendingFriends().values()) {
if (friendship.getAskerId() == player.getId()) { if (friendship.getAskerId() == player.getUid()) {
continue; continue;
} }
proto.addAskFriendList(friendship.toProto()); proto.addAskFriendList(friendship.toProto());
......
...@@ -37,7 +37,7 @@ public class PacketGetPlayerFriendListRsp extends GenshinPacket { ...@@ -37,7 +37,7 @@ public class PacketGetPlayerFriendListRsp extends GenshinPacket {
proto.addFriendList(friendship.toProto()); proto.addFriendList(friendship.toProto());
} }
for (Friendship friendship : player.getFriendsList().getPendingFriends().values()) { for (Friendship friendship : player.getFriendsList().getPendingFriends().values()) {
if (friendship.getAskerId() == player.getId()) { if (friendship.getAskerId() == player.getUid()) {
continue; continue;
} }
proto.addAskFriendList(friendship.toProto()); proto.addAskFriendList(friendship.toProto());
......
...@@ -16,8 +16,8 @@ public class PacketGetSceneAreaRsp extends GenshinPacket { ...@@ -16,8 +16,8 @@ public class PacketGetSceneAreaRsp extends GenshinPacket {
this.buildHeader(0); this.buildHeader(0);
GetSceneAreaRsp p = GetSceneAreaRsp.newBuilder() GetSceneAreaRsp p = GetSceneAreaRsp.newBuilder()
.setSceneId(3) .setSceneId(sceneId)
.addAllAreaIdList(Arrays.stream(new int[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19}).boxed().collect(Collectors.toList())) .addAllAreaIdList(Arrays.stream(new int[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,100,101,102,103,200,210,300}).boxed().collect(Collectors.toList()))
.addCityInfoList(CityInfo.newBuilder().setCityId(1).setLevel(1).build()) .addCityInfoList(CityInfo.newBuilder().setCityId(1).setLevel(1).build())
.addCityInfoList(CityInfo.newBuilder().setCityId(2).setLevel(1).build()) .addCityInfoList(CityInfo.newBuilder().setCityId(2).setLevel(1).build())
.addCityInfoList(CityInfo.newBuilder().setCityId(3).setLevel(1).build()) .addCityInfoList(CityInfo.newBuilder().setCityId(3).setLevel(1).build())
......
...@@ -11,7 +11,7 @@ public class PacketHostPlayerNotify extends GenshinPacket { ...@@ -11,7 +11,7 @@ public class PacketHostPlayerNotify extends GenshinPacket {
super(PacketOpcodes.HostPlayerNotify); super(PacketOpcodes.HostPlayerNotify);
HostPlayerNotify proto = HostPlayerNotify.newBuilder() HostPlayerNotify proto = HostPlayerNotify.newBuilder()
.setHostUid(world.getHost().getId()) .setHostUid(world.getHost().getUid())
.setHostPeerId(world.getHost().getPeerId()) .setHostPeerId(world.getHost().getPeerId())
.build(); .build();
......
...@@ -12,7 +12,7 @@ public class PacketPlayerApplyEnterMpResultNotify extends GenshinPacket { ...@@ -12,7 +12,7 @@ public class PacketPlayerApplyEnterMpResultNotify extends GenshinPacket {
super(PacketOpcodes.PlayerApplyEnterMpResultNotify); super(PacketOpcodes.PlayerApplyEnterMpResultNotify);
PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder() PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder()
.setTargetUid(target.getId()) .setTargetUid(target.getUid())
.setTargetNickname(target.getNickname()) .setTargetNickname(target.getNickname())
.setIsAgreed(isAgreed) .setIsAgreed(isAgreed)
.setReason(reason) .setReason(reason)
......
...@@ -14,7 +14,7 @@ public class PacketPlayerChatNotify extends GenshinPacket { ...@@ -14,7 +14,7 @@ public class PacketPlayerChatNotify extends GenshinPacket {
ChatInfo info = ChatInfo.newBuilder() ChatInfo info = ChatInfo.newBuilder()
.setTime((int) (System.currentTimeMillis() / 1000)) .setTime((int) (System.currentTimeMillis() / 1000))
.setUid(sender.getId()) .setUid(sender.getUid())
.setText(message) .setText(message)
.build(); .build();
...@@ -31,7 +31,7 @@ public class PacketPlayerChatNotify extends GenshinPacket { ...@@ -31,7 +31,7 @@ public class PacketPlayerChatNotify extends GenshinPacket {
ChatInfo info = ChatInfo.newBuilder() ChatInfo info = ChatInfo.newBuilder()
.setTime((int) (System.currentTimeMillis() / 1000)) .setTime((int) (System.currentTimeMillis() / 1000))
.setUid(sender.getId()) .setUid(sender.getUid())
.setIcon(emote) .setIcon(emote)
.build(); .build();
...@@ -48,7 +48,7 @@ public class PacketPlayerChatNotify extends GenshinPacket { ...@@ -48,7 +48,7 @@ public class PacketPlayerChatNotify extends GenshinPacket {
ChatInfo info = ChatInfo.newBuilder() ChatInfo info = ChatInfo.newBuilder()
.setTime((int) (System.currentTimeMillis() / 1000)) .setTime((int) (System.currentTimeMillis() / 1000))
.setUid(sender.getId()) .setUid(sender.getUid())
.setSystemHint(systemHint) .setSystemHint(systemHint)
.build(); .build();
......
...@@ -24,17 +24,13 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket { ...@@ -24,17 +24,13 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
.setPos(player.getPos().toProto()) .setPos(player.getPos().toProto())
.setSceneBeginTime(System.currentTimeMillis()) .setSceneBeginTime(System.currentTimeMillis())
.setType(EnterType.EnterSelf) .setType(EnterType.EnterSelf)
.setTargetUid(player.getId()) .setTargetUid(player.getUid())
.setEnterSceneToken(player.getEnterSceneToken()) .setEnterSceneToken(player.getEnterSceneToken())
.setWorldLevel(player.getWorldLevel()) .setWorldLevel(player.getWorldLevel())
.setEnterReason(EnterReason.Login.getValue()) .setEnterReason(EnterReason.Login.getValue())
.setIsFirstLoginEnterScene(player.isFirstLoginEnterScene()) .setIsFirstLoginEnterScene(player.isFirstLoginEnterScene())
.addSceneTagIdList(102)
.addSceneTagIdList(107)
.addSceneTagIdList(113)
.addSceneTagIdList(117)
.setUnk1(1) .setUnk1(1)
.setUnk2("3-" + player.getId() + "-" + (int) (System.currentTimeMillis() / 1000) + "-" + 18402) .setUnk2("3-" + player.getUid() + "-" + (int) (System.currentTimeMillis() / 1000) + "-" + 18402)
.build(); .build();
this.setData(proto); this.setData(proto);
...@@ -57,7 +53,7 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket { ...@@ -57,7 +53,7 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
.setPos(newPos.toProto()) .setPos(newPos.toProto())
.setSceneBeginTime(System.currentTimeMillis()) .setSceneBeginTime(System.currentTimeMillis())
.setType(EnterType.EnterSelf) .setType(EnterType.EnterSelf)
.setTargetUid(target.getId()) .setTargetUid(target.getUid())
.setEnterSceneToken(player.getEnterSceneToken()) .setEnterSceneToken(player.getEnterSceneToken())
.setWorldLevel(target.getWorld().getWorldLevel()) .setWorldLevel(target.getWorld().getWorldLevel())
.setEnterReason(reason.getValue()) .setEnterReason(reason.getValue())
...@@ -66,7 +62,7 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket { ...@@ -66,7 +62,7 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
.addSceneTagIdList(113) .addSceneTagIdList(113)
.addSceneTagIdList(117) .addSceneTagIdList(117)
.setUnk1(1) .setUnk1(1)
.setUnk2(newScene + "-" + target.getId() + "-" + (int) (System.currentTimeMillis() / 1000) + "-" + 18402) .setUnk2(newScene + "-" + target.getUid() + "-" + (int) (System.currentTimeMillis() / 1000) + "-" + 18402)
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -8,12 +8,12 @@ import emu.grasscutter.net.proto.PlayerGameTimeNotifyOuterClass.PlayerGameTimeNo ...@@ -8,12 +8,12 @@ import emu.grasscutter.net.proto.PlayerGameTimeNotifyOuterClass.PlayerGameTimeNo
public class PacketPlayerGameTimeNotify extends GenshinPacket { public class PacketPlayerGameTimeNotify extends GenshinPacket {
public PacketPlayerGameTimeNotify(World world, GenshinPlayer player) { public PacketPlayerGameTimeNotify(GenshinPlayer player) {
super(PacketOpcodes.PlayerGameTimeNotify); super(PacketOpcodes.PlayerGameTimeNotify);
PlayerGameTimeNotify proto = PlayerGameTimeNotify.newBuilder() PlayerGameTimeNotify proto = PlayerGameTimeNotify.newBuilder()
.setGameTime(world.getTime()) .setGameTime(player.getScene().getTime())
.setUid(player.getId()) .setUid(player.getUid())
.build(); .build();
this.setData(proto); this.setData(proto);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.GenshinConstants; import emu.grasscutter.GenshinConstants;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.inventory.GenshinItem; import emu.grasscutter.game.inventory.GenshinItem;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
...@@ -18,7 +19,7 @@ public class PacketPlayerStoreNotify extends GenshinPacket { ...@@ -18,7 +19,7 @@ public class PacketPlayerStoreNotify extends GenshinPacket {
PlayerStoreNotify.Builder p = PlayerStoreNotify.newBuilder() PlayerStoreNotify.Builder p = PlayerStoreNotify.newBuilder()
.setStoreType(StoreType.StorePack) .setStoreType(StoreType.StorePack)
.setWeightLimit(GenshinConstants.LIMIT_ALL); .setWeightLimit(Grasscutter.getConfig().getServerOptions().InventoryLimitAll);
for (GenshinItem item : player.getInventory()) { for (GenshinItem item : player.getInventory()) {
Item itemProto = item.toProto(); Item itemProto = item.toProto();
......
...@@ -21,7 +21,7 @@ public class PacketPullRecentChatRsp extends GenshinPacket { ...@@ -21,7 +21,7 @@ public class PacketPullRecentChatRsp extends GenshinPacket {
ChatInfo welcomeEmote = ChatInfo.newBuilder() ChatInfo welcomeEmote = ChatInfo.newBuilder()
.setTime((int) (System.currentTimeMillis() / 1000)) .setTime((int) (System.currentTimeMillis() / 1000))
.setUid(GenshinConstants.SERVER_CONSOLE_UID) .setUid(GenshinConstants.SERVER_CONSOLE_UID)
.setToUid(player.getId()) .setToUid(player.getUid())
.setIcon(serverOptions.WelcomeEmotes[Utils.randomRange(0, serverOptions.WelcomeEmotes.length - 1)]) .setIcon(serverOptions.WelcomeEmotes[Utils.randomRange(0, serverOptions.WelcomeEmotes.length - 1)])
.build(); .build();
...@@ -32,7 +32,7 @@ public class PacketPullRecentChatRsp extends GenshinPacket { ...@@ -32,7 +32,7 @@ public class PacketPullRecentChatRsp extends GenshinPacket {
ChatInfo welcomeMotd = ChatInfo.newBuilder() ChatInfo welcomeMotd = ChatInfo.newBuilder()
.setTime((int) (System.currentTimeMillis() / 1000)) .setTime((int) (System.currentTimeMillis() / 1000))
.setUid(GenshinConstants.SERVER_CONSOLE_UID) .setUid(GenshinConstants.SERVER_CONSOLE_UID)
.setToUid(player.getId()) .setToUid(player.getUid())
.setText(Grasscutter.getConfig().getServerOptions().WelcomeMotd) .setText(Grasscutter.getConfig().getServerOptions().WelcomeMotd)
.build(); .build();
......
...@@ -8,12 +8,12 @@ import emu.grasscutter.net.proto.SceneAreaWeatherNotifyOuterClass.SceneAreaWeath ...@@ -8,12 +8,12 @@ import emu.grasscutter.net.proto.SceneAreaWeatherNotifyOuterClass.SceneAreaWeath
public class PacketSceneAreaWeatherNotify extends GenshinPacket { public class PacketSceneAreaWeatherNotify extends GenshinPacket {
public PacketSceneAreaWeatherNotify(World world, GenshinPlayer player) { public PacketSceneAreaWeatherNotify(GenshinPlayer player) {
super(PacketOpcodes.SceneAreaWeatherNotify); super(PacketOpcodes.SceneAreaWeatherNotify);
SceneAreaWeatherNotify proto = SceneAreaWeatherNotify.newBuilder() SceneAreaWeatherNotify proto = SceneAreaWeatherNotify.newBuilder()
.setWeatherAreaId(1) .setWeatherAreaId(1)
.setClimateType(world.getClimate().getValue()) .setClimateType(player.getScene().getClimate().getValue())
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -18,10 +18,10 @@ public class PacketScenePlayerInfoNotify extends GenshinPacket { ...@@ -18,10 +18,10 @@ public class PacketScenePlayerInfoNotify extends GenshinPacket {
GenshinPlayer p = world.getPlayers().get(i); GenshinPlayer p = world.getPlayers().get(i);
ScenePlayerInfo pInfo = ScenePlayerInfo.newBuilder() ScenePlayerInfo pInfo = ScenePlayerInfo.newBuilder()
.setUid(p.getId()) .setUid(p.getUid())
.setPeerId(p.getPeerId()) .setPeerId(p.getPeerId())
.setName(p.getNickname()) .setName(p.getNickname())
.setSceneId(world.getSceneId()) .setSceneId(p.getSceneId())
.setOnlinePlayerInfo(p.getOnlinePlayerInfo()) .setOnlinePlayerInfo(p.getOnlinePlayerInfo())
.build(); .build();
......
...@@ -19,7 +19,7 @@ public class PacketSceneTeamUpdateNotify extends GenshinPacket { ...@@ -19,7 +19,7 @@ public class PacketSceneTeamUpdateNotify extends GenshinPacket {
for (GenshinPlayer p : player.getWorld().getPlayers()) { for (GenshinPlayer p : player.getWorld().getPlayers()) {
for (EntityAvatar entityAvatar : p.getTeamManager().getActiveTeam()) { for (EntityAvatar entityAvatar : p.getTeamManager().getActiveTeam()) {
SceneTeamAvatar.Builder avatarProto = SceneTeamAvatar.newBuilder() SceneTeamAvatar.Builder avatarProto = SceneTeamAvatar.newBuilder()
.setPlayerId(p.getId()) .setPlayerId(p.getUid())
.setAvatarGuid(entityAvatar.getAvatar().getGuid()) .setAvatarGuid(entityAvatar.getAvatar().getGuid())
.setSceneId(p.getSceneId()) .setSceneId(p.getSceneId())
.setEntityId(entityAvatar.getId()) .setEntityId(entityAvatar.getId())
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneUnlockInfoNotifyOuterClass.SceneUnlockInfoNotify;
import emu.grasscutter.net.proto.SceneUnlockInfoOuterClass.SceneUnlockInfo;
public class PacketSceneUnlockInfoNotify extends GenshinPacket {
public PacketSceneUnlockInfoNotify() {
super(PacketOpcodes.SceneUnlockInfoNotify); // Rename opcode later
SceneUnlockInfoNotify proto = SceneUnlockInfoNotify.newBuilder()
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(1))
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(3))
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(4))
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(5))
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(6))
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(7))
.build();
this.setData(proto);
}
}
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.GenshinConstants; import emu.grasscutter.Grasscutter;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType; import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType;
...@@ -13,11 +13,11 @@ public class PacketStoreWeightLimitNotify extends GenshinPacket { ...@@ -13,11 +13,11 @@ public class PacketStoreWeightLimitNotify extends GenshinPacket {
StoreWeightLimitNotify p = StoreWeightLimitNotify.newBuilder() StoreWeightLimitNotify p = StoreWeightLimitNotify.newBuilder()
.setStoreType(StoreType.StorePack) .setStoreType(StoreType.StorePack)
.setWeightLimit(GenshinConstants.LIMIT_ALL) .setWeightLimit(Grasscutter.getConfig().getServerOptions().InventoryLimitAll)
.setWeaponCountLimit(GenshinConstants.LIMIT_WEAPON) .setWeaponCountLimit(Grasscutter.getConfig().getServerOptions().InventoryLimitWeapon)
.setReliquaryCountLimit(GenshinConstants.LIMIT_RELIC) .setReliquaryCountLimit(Grasscutter.getConfig().getServerOptions().InventoryLimitRelic)
.setMaterialCountLimit(GenshinConstants.LIMIT_MATERIAL) .setMaterialCountLimit(Grasscutter.getConfig().getServerOptions().InventoryLimitMaterial)
.setFurnitureCountLimit(GenshinConstants.LIMIT_FURNITURE) .setFurnitureCountLimit(Grasscutter.getConfig().getServerOptions().InventoryLimitFurniture)
.build(); .build();
this.setData(p); this.setData(p);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment