mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-09 03:42:57 +08:00
Fix lock clock (#2201)
* Fix lock clock * Update src/main/java/emu/grasscutter/game/world/World.java Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com> * Update src/main/java/emu/grasscutter/server/packet/recv/HandlerClientLockGameTimeNotify.java Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com> * Update src/main/java/emu/grasscutter/server/packet/recv/HandlerClientLockGameTimeNotify.java Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com> --------- Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com>
This commit is contained in:
parent
2788206934
commit
15699e562a
@ -35,7 +35,8 @@ public class World implements Iterable<Player> {
|
||||
private int nextPeerId = 0;
|
||||
private int worldLevel;
|
||||
|
||||
@Getter private boolean isMultiplayer, timeLocked = false;
|
||||
@Getter private boolean isMultiplayer = false;
|
||||
@Getter private boolean timeLocked;
|
||||
|
||||
private long lastUpdateTime;
|
||||
@Getter private int tickCount = 0;
|
||||
@ -56,6 +57,7 @@ public class World implements Iterable<Player> {
|
||||
this.entity = new EntityWorld(this);
|
||||
this.worldLevel = player.getWorldLevel();
|
||||
this.isMultiplayer = isMultiplayer;
|
||||
this.timeLocked = player.getProperty(PlayerProperty.PROP_IS_GAME_TIME_LOCKED) != 0;
|
||||
|
||||
this.lastUpdateTime = System.currentTimeMillis();
|
||||
this.currentWorldTime = host.getPlayerGameTime();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package emu.grasscutter.server.packet.recv;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.net.packet.Opcodes;
|
||||
import emu.grasscutter.net.packet.PacketHandler;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
@ -11,6 +12,8 @@ public final class HandlerClientLockGameTimeNotify extends PacketHandler {
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||
var packet = ClientLockGameTimeNotify.parseFrom(payload);
|
||||
session.getPlayer().getWorld().lockTime(packet.getIsLock());
|
||||
// session.getPlayer().getWorld().lockTime(packet.getIsLock());
|
||||
// TODO: figure out what to implement here
|
||||
if (packet.getIsLock()) Grasscutter.getLogger().warn("Invalid 'ClientLockGameTimeNotify' received; value is true. (please report to development channel)");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user