GamePacketHandler class
Пакет: com.hypixel.hytale.server.core.io.handlers.game
Файл: com/hypixel/hytale/server/core/io/handlers/game/GamePacketHandler.java
extends: GenericPacketHandler
implements: IPacketHandler
Поля (94)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
HytaleLogger |
LOGGER |
|
|
return |
|
|
return |
|
|
return |
|
|
return |
|
|
return |
|
boolean[] |
var1 |
|
Ref |
var10 |
|
int |
var10 |
|
int |
var11 |
|
WorldChunk |
var12 |
|
int |
var13 |
|
Teleport |
var14 |
|
HytaleServerConfig.TimeoutProfile |
var2 |
|
Vector3d |
var2 |
|
|
var2 |
|
String |
var2 |
|
ArgumentType |
var2 |
|
Ref |
var2 |
|
List |
var2 |
|
List |
var2 |
|
HytaleServerConfig |
var2 |
|
ModelAsset |
var2 |
|
CompletableFuture |
var2 |
|
int |
var2 |
|
boolean |
var3 |
|
|
var3 |
|
char |
var3 |
|
Message |
var3 |
|
long |
var3 |
|
Store |
var3 |
|
Player |
var3 |
|
Ref |
var3 |
|
Player |
var3 |
|
Store |
var3 |
|
int |
var3 |
|
TeleportAckTracker.Result |
var4 |
|
Ref |
var4 |
|
World |
var4 |
|
PageManager |
var4 |
|
Store |
var4 |
|
TransformComponent |
var4 |
|
Store |
var4 |
|
int |
var4 |
|
boolean |
var5 |
|
UUID |
var5 |
|
Ref |
var5 |
|
ComponentType |
var5 |
|
World |
var5 |
|
HeadRotation |
var5 |
|
BlockChunk |
var5 |
|
Player |
var6 |
|
Ref |
var6 |
|
Player |
var6 |
|
Collection |
var6 |
|
SuggestionResult |
var6 |
|
Player |
var6 |
|
Supplier |
var6 |
|
Player |
var6 |
|
InventoryComponent.Armor |
var6 |
|
Player |
var6 |
|
Rotation3f |
var6 |
|
Player |
var6 |
|
Player |
var6 |
|
Player |
var6 |
|
Vector3d |
var6 |
|
WorldMapManager |
var6 |
|
SyncInteractionChain |
var6 |
|
Player |
var6 |
|
Map |
var6 |
|
Player |
var6 |
|
Store |
var7 |
|
PlayerInput |
var7 |
|
List |
var7 |
|
ArgValuesResponse |
var7 |
|
EntityTrackerSystems.EntityViewer |
var7 |
|
Player |
var7 |
|
Window |
var7 |
|
SingleplayerModule |
var7 |
|
InetSocketAddress |
var7 |
|
WorldMapTracker |
var7 |
|
HeadRotation |
var7 |
|
Ref |
var7 |
|
boolean |
var7 |
|
World |
var8 |
|
int |
var8 |
|
UpdateWindow |
var8 |
|
MapMarker |
var8 |
|
Rotation3fc |
var8 |
|
TransformComponent |
var8 |
|
Vector3d |
var9 |
|
Transform |
var9 |
|
Teleport |
var9 |
|
MovementStatesComponent |
var9 |
Методы (83)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
throw new |
IllegalArgumentExceptionthrow new IllegalArgumentException("UpdateServerAccess can only be used in singleplayer!") |
abstract |
throw new |
IllegalArgumentExceptionthrow new IllegalArgumentException("UpdateServerAccess can only be by the owner of the singleplayer world!") |
abstract |
throw new |
IllegalArgumentExceptionthrow new IllegalArgumentException("ConfigureIcePeer can only be used in singleplayer!") |
abstract |
throw new |
IllegalArgumentExceptionthrow new IllegalArgumentException("ConfigureIcePeer can only be sent by the owner of the singleplayer world!") |
abstract |
throw new |
IllegalArgumentExceptionthrow new IllegalArgumentException("ConfigureIcePeer carried malformed ICE credentials") |
abstract |
throw new |
IllegalArgumentExceptionthrow new IllegalArgumentException("SetServerAccess can only be used in singleplayer!") |
abstract |
throw new |
IllegalArgumentExceptionthrow new IllegalArgumentException("SetServerAccess can only be used by the owner of the singleplayer world!") |
abstract |
throw new |
RuntimeExceptionthrow new RuntimeException("Unable to process ClientOpenWindow packet. Window type is not supported!") |
|
|
for for(PlayerRef var9 : var6) |
|
|
for for(int var2 = 0; var2 < var1.length; var2++) |
|
|
for for(HostAddress var6 : var1.hosts) |
|
|
for for(HostAddress var6 : var1.remoteCandidates) |
|
|
for for(int var5 = var3; var5 < var1.updates.length; var5++) |
public |
void |
handlevoid handle(@Nonnull ClientDisconnect var1) |
public |
void |
handlevoid handle(@Nonnull ClientMovement var1) |
public |
void |
handlevoid handle(@Nonnull ChatMessage var1) |
public |
void |
handlevoid handle(@Nonnull ArgValuesRequest var1) |
public |
void |
handlevoid handle(@Nonnull CustomPageEvent var1) |
public |
void |
handlevoid handle(@Nonnull UpdateServerAccess var1) |
public |
void |
handlevoid handle(@Nonnull ConfigureIcePeer var1) |
public |
void |
handlevoid handle(@Nonnull SetServerAccess var1) |
public |
void |
handlevoid handle(@Nonnull RequestMachinimaActorModel var1) |
public |
void |
handlevoid handle(@Nonnull ClientReady var1) |
public |
void |
handlevoid handle(@Nonnull SyncInteractionChains var1) |
protected |
void |
handleClientOpenWindowvoid handleClientOpenWindow(@Nonnull ClientOpenWindow var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleCloseWindowvoid handleCloseWindow(@Nonnull CloseWindow var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleCreateUserMarkervoid handleCreateUserMarker(@Nonnull CreateUserMarker var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleMountMovementvoid handleMountMovement(@Nonnull MountMovement var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleMouseInteractionvoid handleMouseInteraction(@Nonnull MouseInteraction var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handlePlayEmotevoid handlePlayEmote(@Nonnull PlayEmote var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleRemoveMapMarkervoid handleRemoveMapMarker(@Nonnull RemoveMapMarker var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleRequestFlyCameraModevoid handleRequestFlyCameraMode(@Nonnull RequestFlyCameraMode var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleRequestNoClipvoid handleRequestNoClip(@Nonnull RequestNoClip var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleSendWindowActionvoid handleSendWindowAction(@Nonnull SendWindowAction var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleSetPausedvoid handleSetPaused(@Nonnull SetPaused var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
static |
void |
handleSyncPlayerPreferencesvoid handleSyncPlayerPreferences(@Nonnull SyncPlayerPreferences var0, @Nonnull PlayerRef var1, @Nonnull Ref<EntityStore> var2, @Nonnull World var3, @Nonnull Store<EntityStore> var4) |
public |
void |
handleTeleportToWorldMapMarkervoid handleTeleportToWorldMapMarker(@Nonnull TeleportToWorldMapMarker var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleTeleportToWorldMapPositionvoid handleTeleportToWorldMapPosition(@Nonnull TeleportToWorldMapPosition var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleUpdateLanguagevoid handleUpdateLanguage(@Nonnull UpdateLanguage var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleUpdateMachinimaScenevoid handleUpdateMachinimaScene(@Nonnull UpdateMachinimaScene var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleUpdateWorldMapVisiblevoid handleUpdateWorldMapVisible(@Nonnull UpdateWorldMapVisible var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
public |
void |
handleViewRadiusvoid handleViewRadius(@Nonnull ViewRadius var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5) |
|
|
if if(var1 == null || var1 == NetworkChannel.Default) |
|
|
if if(this.playerRef != null) |
|
|
if if(var1.teleportAck == null) |
|
|
if if(var7 != null) |
|
|
if if(var1.movementStates != null) |
|
|
if if(var1.velocity != null) |
|
|
if if(var1.mountedTo != 0 && var1.riderMovementStates != null) |
|
|
if if(var1.bodyOrientation != null) |
|
|
if if(var1.lookOrientation != null) |
|
|
if if(var1.wishMovement != null) |
|
|
if if(var1.absolutePosition != null) |
|
|
if if(var3 == '/') |
|
|
if if(var2x != null) |
|
|
if if(var2 != null) |
|
|
if if(this.playerRef != null) |
|
|
if if(var6 == null) |
|
|
if if(var8 != null) |
|
|
if if(var7 != null) |
|
|
if if(var6 != null) |
|
|
if if(!Constants.SINGLEPLAYER) |
|
|
if if(!Constants.SINGLEPLAYER) |
|
|
if if(var1.remove) |
|
|
if if(var7 != null) |
|
|
if if(!Constants.SINGLEPLAYER) |
|
|
if if(var2 != null) |
|
|
if if(var2 != null) |
|
|
if if(var1.readyForChunks && !var1.readyForGameplay && var2 != null) |
|
|
if if(var1.readyForGameplay) |
|
|
if if(var8 != null) |
|
|
if if(var3 < var1.updates.length) |
|
|
if if(var6.initial) |
|
|
if if(var6 != null) |
|
|
if if(var8 != null) |
|
|
if if(var9 != null) |
|
|
if if(var1.entering) |
protected |
void |
registerHandlersvoid registerHandlers() |
|
protected boolean |
removeEldestEntryprotected boolean removeEldestEntry(@Nonnull Entry<String, Long> var1) |
public |
void |
sendCommandTreevoid sendCommandTree() |
public |
void |
setPlayerRefvoid setPlayerRef(@Nonnull PlayerRef var1) |
abstract |
|
super super(var1, var2) |
static |
boolean[] |
toBooleanArrayboolean[] toBooleanArray(@Nonnull List<Boolean> var0) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.io.handlers.game;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.logger.HytaleLogger;
class="kw">import com.hypixel.hytale.math.util.ChunkUtil;
class="kw">import com.hypixel.hytale.math.util.MathUtil;
class="kw">import com.hypixel.hytale.math.vector.Rotation3f;
class="kw">import com.hypixel.hytale.math.vector.Rotation3fc;
class="kw">import com.hypixel.hytale.math.vector.Transform;
class="kw">import com.hypixel.hytale.protocol.AnimationSlot;
class="kw">import com.hypixel.hytale.protocol.FormattedMessage;
class="kw">import com.hypixel.hytale.protocol.HostAddress;
class="kw">import com.hypixel.hytale.protocol.NetworkChannel;
class="kw">import com.hypixel.hytale.protocol.io.ChannelConnection;
class="kw">import com.hypixel.hytale.protocol.io.ConnectionHandler;
class="kw">import com.hypixel.hytale.protocol.packets.camera.RequestFlyCameraMode;
class="kw">import com.hypixel.hytale.protocol.packets.camera.SetFlyCameraMode;
class="kw">import com.hypixel.hytale.protocol.packets.connection.ClientDisconnect;
class="kw">import com.hypixel.hytale.protocol.packets.connection.Pong;
class="kw">import com.hypixel.hytale.protocol.packets.entities.MountMovement;
class="kw">import com.hypixel.hytale.protocol.packets.entities.PlayEmote;
class="kw">import com.hypixel.hytale.protocol.packets.interaction.CancelInteractionChain;
class="kw">import com.hypixel.hytale.protocol.packets.interaction.SyncInteractionChain;
class="kw">import com.hypixel.hytale.protocol.packets.interaction.SyncInteractionChains;
class="kw">import com.hypixel.hytale.protocol.packets.interface_.ArgValuesRequest;
class="kw">import com.hypixel.hytale.protocol.packets.interface_.ArgValuesResponse;
class="kw">import com.hypixel.hytale.protocol.packets.interface_.ChatMessage;
class="kw">import com.hypixel.hytale.protocol.packets.interface_.CustomPageEvent;
class="kw">import com.hypixel.hytale.protocol.packets.interface_.Page;
class="kw">import com.hypixel.hytale.protocol.packets.interface_.SetPage;
class="kw">import com.hypixel.hytale.protocol.packets.interface_.UpdateLanguage;
class="kw">import com.hypixel.hytale.protocol.packets.machinima.RequestMachinimaActorModel;
class="kw">import com.hypixel.hytale.protocol.packets.machinima.SetMachinimaActorModel;
class="kw">import com.hypixel.hytale.protocol.packets.machinima.UpdateMachinimaScene;
class="kw">import com.hypixel.hytale.protocol.packets.player.ClientMovement;
class="kw">import com.hypixel.hytale.protocol.packets.player.ClientReady;
class="kw">import com.hypixel.hytale.protocol.packets.player.MouseInteraction;
class="kw">import com.hypixel.hytale.protocol.packets.player.RemoveMapMarker;
class="kw">import com.hypixel.hytale.protocol.packets.player.RequestNoClip;
class="kw">import com.hypixel.hytale.protocol.packets.player.SyncPlayerPreferences;
class="kw">import com.hypixel.hytale.protocol.packets.serveraccess.ConfigureIcePeer;
class="kw">import com.hypixel.hytale.protocol.packets.serveraccess.SetServerAccess;
class="kw">import com.hypixel.hytale.protocol.packets.serveraccess.UpdateServerAccess;
class="kw">import com.hypixel.hytale.protocol.packets.setup.ViewRadius;
class="kw">import com.hypixel.hytale.protocol.packets.window.ClientOpenWindow;
class="kw">import com.hypixel.hytale.protocol.packets.window.CloseWindow;
class="kw">import com.hypixel.hytale.protocol.packets.window.SendWindowAction;
class="kw">import com.hypixel.hytale.protocol.packets.window.UpdateWindow;
class="kw">import com.hypixel.hytale.protocol.packets.world.SetPaused;
class="kw">import com.hypixel.hytale.protocol.packets.worldmap.CreateUserMarker;
class="kw">import com.hypixel.hytale.protocol.packets.worldmap.MapMarker;
class="kw">import com.hypixel.hytale.protocol.packets.worldmap.TeleportToWorldMapMarker;
class="kw">import com.hypixel.hytale.protocol.packets.worldmap.TeleportToWorldMapPosition;
class="kw">import com.hypixel.hytale.protocol.packets.worldmap.UpdateWorldMapVisible;
class="kw">import com.hypixel.hytale.server.core.Constants;
class="kw">import com.hypixel.hytale.server.core.HytaleServer;
class="kw">import com.hypixel.hytale.server.core.HytaleServerConfig;
class="kw">import com.hypixel.hytale.server.core.Message;
class="kw">import com.hypixel.hytale.server.core.asset.type.model.config.Model;
class="kw">import com.hypixel.hytale.server.core.asset.type.model.config.ModelAsset;
class="kw">import com.hypixel.hytale.server.core.auth.PlayerAuthentication;
class="kw">import com.hypixel.hytale.server.core.command.system.CommandManager;
class="kw">import com.hypixel.hytale.server.core.command.system.arguments.types.ArgumentType;
class="kw">import com.hypixel.hytale.server.core.command.system.suggestion.SuggestionResult;
class="kw">import com.hypixel.hytale.server.core.console.ConsoleModule;
class="kw">import com.hypixel.hytale.server.core.cosmetics.CosmeticsModule;
class="kw">import com.hypixel.hytale.server.core.cosmetics.Emote;
class="kw">import com.hypixel.hytale.server.core.cosmetics.EmoteAsset;
class="kw">import com.hypixel.hytale.server.core.entity.AnimationUtils;
class="kw">import com.hypixel.hytale.server.core.entity.entities.Player;
class="kw">import com.hypixel.hytale.server.core.entity.entities.player.pages.PageManager;
class="kw">import com.hypixel.hytale.server.core.entity.entities.player.windows.ValidatedWindow;
class="kw">import com.hypixel.hytale.server.core.entity.entities.player.windows.Window;
class="kw">import com.hypixel.hytale.server.core.entity.movement.MovementStatesComponent;
class="kw">import com.hypixel.hytale.server.core.event.events.player.PlayerChatEvent;
class="kw">import com.hypixel.hytale.server.core.inventory.InventoryComponent;
class="kw">import com.hypixel.hytale.server.core.io.ProtocolVersion;
class="kw">import com.hypixel.hytale.server.core.io.ServerManager;
class="kw">import com.hypixel.hytale.server.core.io.handlers.GenericPacketHandler;
class="kw">import com.hypixel.hytale.server.core.io.handlers.IPacketHandler;
class="kw">import com.hypixel.hytale.server.core.io.handlers.IWorldPacketHandler;
class="kw">import com.hypixel.hytale.server.core.io.handlers.SubPacketHandler;
class="kw">import com.hypixel.hytale.server.core.io.ice.IceAddressFilter;
class="kw">import com.hypixel.hytale.server.core.io.ice.IceCredentials;
class="kw">import com.hypixel.hytale.server.core.io.ice.IceModule;
class="kw">import com.hypixel.hytale.server.core.modules.entity.EntityModule;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.HeadRotation;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.PreventEmotes;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.TransformComponent;
class="kw">import com.hypixel.hytale.server.core.modules.entity.gamemode.GameModeTypeState;
class="kw">import com.hypixel.hytale.server.core.modules.entity.player.PlayerCreativeSettings;
class="kw">import com.hypixel.hytale.server.core.modules.entity.player.PlayerInput;
class="kw">import com.hypixel.hytale.server.core.modules.entity.player.PlayerSettings;
class="kw">import com.hypixel.hytale.server.core.modules.entity.player.PlayerVoiceSettings;
class="kw">import com.hypixel.hytale.server.core.modules.entity.teleport.PendingTeleport;
class="kw">import com.hypixel.hytale.server.core.modules.entity.teleport.Teleport;
class="kw">import com.hypixel.hytale.server.core.modules.entity.teleport.TeleportAckTracker;
class="kw">import com.hypixel.hytale.server.core.modules.entity.teleport.TeleportSystems;
class="kw">import com.hypixel.hytale.server.core.modules.entity.tracker.EntityTrackerSystems;
class="kw">import com.hypixel.hytale.server.core.modules.i18n.I18nModule;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.InteractionModule;
class="kw">import com.hypixel.hytale.server.core.modules.singleplayer.SingleplayerModule;
class="kw">import com.hypixel.hytale.server.core.permissions.HytalePermissions;
class="kw">import com.hypixel.hytale.server.core.universe.PlayerRef;
class="kw">import com.hypixel.hytale.server.core.universe.Universe;
class="kw">import com.hypixel.hytale.server.core.universe.world.World;
class="kw">import com.hypixel.hytale.server.core.universe.world.WorldMapTracker;
class="kw">import com.hypixel.hytale.server.core.universe.world.chunk.BlockChunk;
class="kw">import com.hypixel.hytale.server.core.universe.world.chunk.WorldChunk;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.ChunkStore;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import com.hypixel.hytale.server.core.universe.world.worldmap.WorldMapManager;
class="kw">import com.hypixel.hytale.server.core.universe.world.worldmap.markers.utils.MapMarkerUtils;
class="kw">import com.hypixel.hytale.server.core.util.MessageUtil;
class="kw">import com.hypixel.hytale.server.core.util.PositionUtil;
class="kw">import com.hypixel.hytale.server.core.util.ValidateUtil;
class="kw">import it.unimi.dsi.fastutil.objects.ObjectArrayList;
class="kw">import java.net.InetSocketAddress;
class="kw">import java.util.ArrayList;
class="kw">import java.util.Arrays;
class="kw">import java.util.Collection;
class="kw">import java.util.Deque;
class="kw">import java.util.LinkedHashMap;
class="kw">import java.util.List;
class="kw">import java.util.Map;
class="kw">import java.util.UUID;
class="kw">import java.util.Map.Entry;
class="kw">import java.util.concurrent.CompletableFuture;
class="kw">import java.util.concurrent.ConcurrentLinkedDeque;
class="kw">import java.util.concurrent.CopyOnWriteArrayList;
class="kw">import java.util.function.Supplier;
class="kw">import java.util.logging.Level;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">import org.joml.Vector3d;
class="kw">public class GamePacketHandler class="kw">extends GenericPacketHandler class="kw">implements IPacketHandler {
class="kw">private class="kw">static class="kw">final HytaleLogger LOGGER = HytaleLogger.forEnclosingClass();
class="kw">private class="kw">static class="kw">final double RELATIVE_POSITION_DELTA_SCALE = 10000.0;
class="kw">private class="kw">static class="kw">final int MAX_INTERACTION_QUEUE_SIZE = 1000;
class="kw">private PlayerRef playerRef;
@Nonnull
class="kw">private class="kw">final Deque<SyncInteractionChain> interactionPacketQueue = new ConcurrentLinkedDeque<>();
class="kw">private class="kw">static class="kw">final int MAX_ARG_VALUES_RATE_LIMIT_ENTRIES = 4096;
class="kw">private class="kw">final Map<String, Long> lastArgValuesRequestTimes = new LinkedHashMap<String, Long>(16, 0.75F, true) {
@Override
class="kw">protected boolean removeEldestEntry(@Nonnull Entry<String, Long> var1) {
class="kw">return this.size() > 4096;
}
};
class="kw">private class="kw">static class="kw">final int MAX_WIRE_SUGGESTIONS = 150;
class="kw">public GamePacketHandler(@Nonnull ChannelConnection var1, @Nonnull ProtocolVersion var2, @Nonnull PlayerAuthentication var3) {
super(var1, var2);
this.auth = var3;
ServerManager.get().populateSubPacketHandlers(this);
this.registerHandlers();
}
@Nonnull
class="kw">public Deque<SyncInteractionChain> getInteractionPacketQueue() {
class="kw">return this.interactionPacketQueue;
}
@Nonnull
@Override
class="kw">public PlayerRef getPlayerRef() {
class="kw">return this.playerRef;
}
class="kw">public void setPlayerRef(@Nonnull PlayerRef var1) {
this.playerRef = var1;
}
@Nonnull
@Override
class="kw">public String getIdentifier() {
class="kw">return "{Playing("
+ this.getChannel().formatRemoteAddress()
+ "), "
+ (this.playerRef != null ? this.playerRef.getUuid() + ", " + this.playerRef.getUsername() : "null player")
+ "}";
}
@Override
class="kw">protected void registered0(ConnectionHandler var1) {
HytaleServerConfig.TimeoutProfile var2 = HytaleServer.get().getConfig().getConnectionTimeouts();
this.enterStage("play", var2.getPlay());
this.sendCommandTree();
}
class="kw">public void sendCommandTree() {
if (this.playerRef != null && this.playerRef.isValid()) {
this.write(CommandManager.get().buildCommandTree(this.playerRef));
}
}
class="kw">protected void registerHandlers() {
this.registerHandler(1, var1 -> this.handle((ClientDisconnect)var1));
this.registerHandler(4, var1 -> this.handlePong((Pong)var1));
this.registerHandler(108, var1 -> this.handle((ClientMovement)var1));
this.registerHandler(211, var1 -> this.handle((ChatMessage)var1));
this.registerHandler(239, var1 -> this.handle((ArgValuesRequest)var1));
this.registerHandler(219, var1 -> this.handle((CustomPageEvent)var1));
IWorldPacketHandler.registerHandler(this, 32, this::handleViewRadius);
IWorldPacketHandler.registerHandler(this, 232, this::handleUpdateLanguage);
IWorldPacketHandler.registerHandler(this, 111, this::handleMouseInteraction);
this.registerHandler(251, var1 -> this.handle((UpdateServerAccess)var1));
this.registerHandler(252, var1 -> this.handle((SetServerAccess)var1));
this.registerHandler(254, var1 -> this.handle((ConfigureIcePeer)var1));
IWorldPacketHandler.registerHandler(this, 204, this::handleClientOpenWindow);
IWorldPacketHandler.registerHandler(this, 203, this::handleSendWindowAction);
IWorldPacketHandler.registerHandler(this, 202, this::handleCloseWindow);
this.registerHandler(260, var1 -> this.handle((RequestMachinimaActorModel)var1));
IWorldPacketHandler.registerHandler(this, 262, this::handleUpdateMachinimaScene);
this.registerHandler(105, var1 -> this.handle((ClientReady)var1));
IWorldPacketHandler.registerHandler(this, 166, this::handleMountMovement);
IWorldPacketHandler.registerHandler(this, 167, this::handlePlayEmote);
IWorldPacketHandler.registerHandler(this, 116, GamePacketHandler::handleSyncPlayerPreferences);
IWorldPacketHandler.registerHandler(this, 119, this::handleRemoveMapMarker);
IWorldPacketHandler.registerHandler(this, 243, this::handleUpdateWorldMapVisible);
IWorldPacketHandler.registerHandler(this, 244, this::handleTeleportToWorldMapMarker);
IWorldPacketHandler.registerHandler(this, 245, this::handleTeleportToWorldMapPosition);
IWorldPacketHandler.registerHandler(this, 246, this::handleCreateUserMarker);
this.registerHandler(290, var1 -> this.handle((SyncInteractionChains)var1));
IWorldPacketHandler.registerHandler(this, 158, this::handleSetPaused);
IWorldPacketHandler.registerHandler(this, 282, this::handleRequestFlyCameraMode);
IWorldPacketHandler.registerHandler(this, 122, this::handleRequestNoClip);
this.packetHandlers.forEach(SubPacketHandler::registerHandlers);
}
@Override
class="kw">public void closed(@Nullable NetworkChannel var1) {
super.closed(var1);
if (var1 == null || var1 == NetworkChannel.Default) {
Universe.get().removePlayer(this.playerRef);
}
}
@Override
class="kw">public void disconnect(@Nonnull FormattedMessage var1) {
this.disconnectReason.setServerDisconnectReason(var1);
if (this.playerRef != null) {
HytaleLogger.getLogger()
.at(Level.INFO)
.log(
"Disconnecting %s at %s (SNI: %s) with the message: %s",
this.playerRef.getUsername(),
this.getChannel().formatRemoteAddress(),
this.getSniHostname(),
MessageUtil.formatMessageToPlainString(var1)
);
this.disconnect0(var1);
Universe.get().removePlayer(this.playerRef);
} else {
super.disconnect(var1);
}
}
class="kw">public void handle(@Nonnull ClientDisconnect var1) {
this.disconnectReason.setClientDisconnectType(var1.type);
HytaleLogger.getLogger()
.at(Level.INFO)
.log(
"%s - %s at %s left with reason: %s - %s",
this.playerRef.getUuid(),
this.playerRef.getUsername(),
this.getChannel().formatRemoteAddress(),
var1.type.name(),
var1.reason.name()
);
this.getChannel().closeApplicationConnection();
}
class="kw">public void handleMouseInteraction(
@Nonnull MouseInteraction var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
Player var6 = var5.getComponent(var3, Player.getComponentType());
assert var6 != null;
InteractionModule.get().doMouseInteraction(var3, var5, var1, var6, var2);
}
class="kw">public void handle(@Nonnull ClientMovement var1) {
if (var1.absolutePosition != null && !ValidateUtil.isSafePosition(var1.absolutePosition)) {
this.disconnect(Message.translation("server.general.disconnect.impossiblePosition"));
} else if ((var1.bodyOrientation == null || ValidateUtil.isSafeDirection(var1.bodyOrientation))
&& (var1.lookOrientation == null || ValidateUtil.isSafeDirection(var1.lookOrientation))) {
Vector3d var2 = null;
boolean var3 = false;
label35:
if (var1.teleportAck == null) {
Vector3d var9 = var2;
boolean var5 = var3;
Ref var6 = this.playerRef.getReference();
if (var6 != null && var6.isValid()) {
Store var7 = var6.getStore();
World var8 = var7.getExternalData().getWorld();
var8.execute(
() -> {
if (var6.isValid()) {
Player var6 = var7.getComponent(var6, Player.getComponentType());
assert var6 != null;
if (!var6.isWaitingForClientReady()) {
PlayerInput var7 = var7.getComponent(var6, PlayerInput.getComponentType());
if (var7 != null) {
if (var1.movementStates != null) {
var7.queue(new PlayerInput.SetMovementStates(var1.movementStates));
}
if (var1.velocity != null) {
var7.queue(new PlayerInput.SetClientVelocity(var1.velocity));
}
if (!var5 && this.playerRef.getTeleportAckTracker().isEmpty()) {
TeleportSystems.completeTeleport(var6, var7, var6, var9);
if (var1.mountedTo == var7.getMountId()) {
if (var1.mountedTo != 0 && var1.riderMovementStates != null) {
var7.queue(new PlayerInput.SetRiderMovementStates(var1.riderMovementStates));
}
if (var1.bodyOrientation != null) {
var7.queue(new PlayerInput.SetBody(var1.bodyOrientation));
}
if (var1.lookOrientation != null) {
var7.queue(new PlayerInput.SetHead(var1.lookOrientation));
}
if (var1.wishMovement != null) {
var7.queue(new PlayerInput.WishMovement(var1.wishMovement.x, var1.wishMovement.y, var1.wishMovement.z));
}
if (var1.absolutePosition != null) {
var7.queue(new PlayerInput.AbsoluteMovement(var1.absolutePosition.x, var1.absolutePosition.y, var1.absolutePosition.z));
} else if (var1.relativePosition != null
&& (
var1.relativePosition.x != 0
|| var1.relativePosition.y != 0
|| var1.relativePosition.z != 0
|| var1.movementStates != null
)) {
var7.queue(
new PlayerInput.RelativeMovement(
var1.relativePosition.x / 10000.0, var1.relativePosition.y / 10000.0, var1.relativePosition.z / 10000.0
)
);
}
}
}
}
}
}
}
);
}
} else if (var1.absolutePosition == null) {
this.disconnect(Message.translation("server.general.disconnect.invalidTeleport"));
} else {
TeleportAckTracker.Result var4 = this.playerRef.getTeleportAckTracker().validate(var1.teleportAck.teleportId, var1.absolutePosition);
class="kw">switch (var4.status()) {
case OK:
var2 = var4.ackedPosition();
var3 = var4.remainingQueueDepth() > 0;
break label35;
case INVALID_ID:
LOGGER.at(Level.WARNING)
.log(
"%s sent a teleport ack with an unexpected id: expected %s, received %d, expected position %s, received position %s, remaining queue depth %d",
this.playerRef.getUsername(),
var4.expectedWireId(),
var1.teleportAck.teleportId & 255,
var4.expectedPosition(),
var1.absolutePosition,
var4.remainingQueueDepth()
);
this.disconnect(Message.translation("server.general.disconnect.incorrectTeleportId"));
class="kw">return;
case INVALID_POSITION:
LOGGER.at(Level.WARNING)
.log(
"%s acked teleport id %s away from its target: expected position %s, received position %s, remaining queue depth %d",
this.playerRef.getUsername(),
var4.expectedWireId(),
var4.expectedPosition(),
var1.absolutePosition,
var4.remainingQueueDepth()
);
this.disconnect(Message.translation("server.general.disconnect.invalidTeleport"));
class="kw">return;
class="kw">default:
break label35;
}
}
} else {
this.disconnect(Message.translation("server.general.disconnect.impossibleOrientation"));
}
}
class="kw">public void handle(@Nonnull ChatMessage var1) {
if (var1.message == null || var1.message.isEmpty()) {
this.disconnect(Message.translation("server.general.disconnect.invalidChatMessage"));
} else if (MessageUtil.containsControlCharacters(var1.message)) {
this.playerRef.sendMessage(Message.translation("server.io.gamepackethandler.invalidMessageContent").param("msg", var1.message));
} else {
String var2 = var1.message;
char var3 = var2.charAt(0);
if (var3 == '/') {
Ref var4 = this.playerRef.getReference();
if (var4 == null || !var4.isValid()) {
class="kw">return;
}
CommandManager.get().handleCommand(this.playerRef, var2.substring(1));
} else if (var3 == '.') {
this.playerRef.sendMessage(Message.translation("server.io.gamepackethandler.localCommandDenied").param("msg", var2));
} else {
Ref var10 = this.playerRef.getReference();
if (var10 == null || !var10.isValid()) {
class="kw">return;
}
UUID var5 = this.playerRef.getUuid();
Collection var6 = Universe.get().getPlayers();
List var7 = new ObjectArrayList(var6.size());
for (PlayerRef var9 : var6) {
if (!var9.getHiddenPlayersManager().isPlayerHidden(var5)) {
var7.add(var9);
}
}
HytaleServer.get()
.getEventBus()
.<String, PlayerChatEvent>dispatchForAsync(PlayerChatEvent.class)
.dispatch(new PlayerChatEvent(this.playerRef, var7, var2))
.whenComplete(
(var1x, var2x) -> {
if (var2x != null) {
((HytaleLogger.Api)HytaleLogger.getLogger().at(Level.SEVERE).withCause(var2x))
.log("An error occurred while dispatching PlayerChatEvent for player %s", this.playerRef.getUsername());
} else if (!var1x.isCancelled()) {
Message var3 = var1x.getFormatter().format(this.playerRef, var1x.getContent());
HytaleLogger.getLogger().at(Level.INFO).log("%s", MessageUtil.toAnsiString(var3).toAnsi(ConsoleModule.get().getTerminal()));
for (PlayerRef var5 : var1x.getTargets()) {
var5.sendMessage(var3);
}
}
}
);
}
}
}
class="kw">public void handle(@Nonnull ArgValuesRequest var1) {
if (var1.argTypeId != null && var1.argTypeId.length() <= 128) {
if (var1.partial == null || var1.partial.length() <= 256) {
ArgumentType var2 = CommandManager.get().getArgTypeById(var1.argTypeId);
if (var2 != null) {
long var3 = System.currentTimeMillis();
if (var3 - this.lastArgValuesRequestTimes.getOrDefault(var1.argTypeId, 0L) >= 50L) {
this.lastArgValuesRequestTimes.put(var1.argTypeId, var3);
if (this.playerRef != null) {
Ref var5 = this.playerRef.getReference();
if (var5 != null && var5.isValid()) {
SuggestionResult var6 = new SuggestionResult(150);
var2.suggest(this.playerRef, var1.partial != null ? var1.partial : "", 0, var6);
ArgValuesResponse var7 = new ArgValuesResponse();
var7.argTypeId = var1.argTypeId;
var7.values = var6.getSuggestions().toArray(new String[0]);
var7.continuations = toBooleanArray(var6.getContinuations());
var7.isComplete = !var6.isTruncated();
this.write(var7);
}
}
}
}
}
}
}
class="kw">private class="kw">static boolean[] toBooleanArray(@Nonnull List<Boolean> var0) {
boolean[] var1 = new boolean[var0.size()];
for (int var2 = 0; var2 < var1.length; var2++) {
var1[var2] = var0.get(var2);
}
class="kw">return var1;
}
class="kw">public void handle(@Nonnull CustomPageEvent var1) {
Ref var2 = this.playerRef.getReference();
if (var2 != null && var2.isValid()) {
Store var3 = var2.getStore();
World var4 = var3.getExternalData().getWorld();
var4.execute(() -> {
if (var2.isValid()) {
Player var3 = var3.getComponent(var2, Player.getComponentType());
assert var3 != null;
PageManager var4 = var3.getPageManager();
var4.handleEvent(var2, var3, var1);
}
});
} else {
this.playerRef.getPacketHandler().writeNoCache(new SetPage(Page.None, true));
}
}
class="kw">public void handleViewRadius(
@Nonnull ViewRadius var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
Player var6 = var5.getComponent(var3, Player.getComponentType());
assert var6 != null;
EntityTrackerSystems.EntityViewer var7 = var5.getComponent(var3, EntityTrackerSystems.EntityViewer.getComponentType());
assert var7 != null;
int var8 = MathUtil.ceil(var1.value / 32.0F);
var6.setClientViewRadius(var8);
var7.viewRadiusBlocks = var6.getViewRadius() * 32;
}
class="kw">public void handleUpdateLanguage(
@Nonnull UpdateLanguage var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
var2.setLanguage(var1.language);
I18nModule.get().sendTranslations(this, var1.language);
}
class="kw">protected void handleClientOpenWindow(
@Nonnull ClientOpenWindow var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
if (!InventoryPacketHandler.blocksInventoryAccess(var3, var5)) {
Supplier var6 = Window.CLIENT_REQUESTABLE_WINDOW_TYPES.get(var1.type);
if (var6 == null) {
throw new RuntimeException("Unable to process ClientOpenWindow packet. Window type is not supported!");
}
Player var7 = var5.getComponent(var3, Player.getComponentType());
assert var7 != null;
UpdateWindow var8 = var7.getWindowManager().clientOpenWindow(var3, var6.get(), var5);
if (var8 != null) {
this.writeNoCache(var8);
}
}
}
class="kw">public void handleSendWindowAction(
@Nonnull SendWindowAction var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
if (!InventoryPacketHandler.blocksInventoryAccess(var3, var5)) {
Player var6 = var5.getComponent(var3, Player.getComponentType());
assert var6 != null;
Window var7 = var6.getWindowManager().getWindow(var1.id);
if (var7 != null) {
if (var7 class="kw">instanceof ValidatedWindow var8 && !var8.validate(var3, var5)) {
var7.close(var3, var5);
} else {
var7.handleAction(var3, var5, var1.action);
}
}
}
}
class="kw">public class="kw">static void handleSyncPlayerPreferences(
@Nonnull SyncPlayerPreferences var0, @Nonnull PlayerRef var1, @Nonnull Ref<EntityStore> var2, @Nonnull World var3, @Nonnull Store<EntityStore> var4
) {
ComponentType var5 = EntityModule.get().getPlayerSettingsComponentType();
var4.putComponent(
var2,
var5,
new PlayerSettings(
var0.showEntityMarkers,
var0.armorItemsPreferredPickupLocation,
var0.weaponAndToolItemsPreferredPickupLocation,
var0.usableItemsItemsPreferredPickupLocation,
var0.solidBlockItemsPreferredPickupLocation,
var0.miscItemsPreferredPickupLocation,
new PlayerCreativeSettings(
var0.allowNPCDetection,
var0.respondToHit,
var0.placeMode,
var0.creativeInteractionDistance,
var0.showBuilderToolNotifications,
var0.noPhysics,
var0.eraserEnabled
),
var0.hideHelmet,
var0.hideCuirass,
var0.hideGauntlets,
var0.hidePants,
new PlayerVoiceSettings(var0.voiceChat, var0.voiceInput, var0.voiceInputMode)
)
);
InventoryComponent.Armor var6 = var4.getComponent(var2, InventoryComponent.Armor.getComponentType());
if (var6 != null) {
var6.setOutdatedEquipment(true);
}
}
class="kw">public void handleRemoveMapMarker(
@Nonnull RemoveMapMarker var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
var4.getWorldMapManager().handleUserRemoveMarker(var2, var1);
}
class="kw">public void handleCloseWindow(
@Nonnull CloseWindow var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
Player var6 = var5.getComponent(var3, Player.getComponentType());
assert var6 != null;
var6.getWindowManager().closeWindow(var3, var1.id, var5);
}
class="kw">public void handle(@Nonnull UpdateServerAccess var1) {
if (!Constants.SINGLEPLAYER) {
throw new IllegalArgumentException("UpdateServerAccess can only be used in singleplayer!");
}
if (!SingleplayerModule.isOwner(this.playerRef)) {
throw new IllegalArgumentException("UpdateServerAccess can only be by the owner of the singleplayer world!");
}
List var2 = new CopyOnWriteArrayList<>();
for (HostAddress var6 : var1.hosts) {
var2.add(InetSocketAddress.createUnresolved(var6.host, var6.port & 65535));
}
SingleplayerModule var7 = SingleplayerModule.get();
var7.setPublicAddresses(var2);
var7.updateAccess(var1.access);
}
class="kw">public void handle(@Nonnull ConfigureIcePeer var1) {
if (!Constants.SINGLEPLAYER) {
throw new IllegalArgumentException("ConfigureIcePeer can only be used in singleplayer!");
}
if (!SingleplayerModule.isOwner(this.playerRef)) {
throw new IllegalArgumentException("ConfigureIcePeer can only be sent by the owner of the singleplayer world!");
}
if (var1.remove) {
IceModule.unregisterPeer(var1.localUfrag);
} else if (IceCredentials.isValid(var1.localUfrag, var1.localPassword) && IceCredentials.isValid(var1.remoteUfrag, var1.remotePassword)) {
List var2 = new ArrayList<>();
for (HostAddress var6 : var1.remoteCandidates) {
InetSocketAddress var7 = IceAddressFilter.parse(var6.host, var6.port & 65535);
if (var7 != null) {
var2.add(var7);
}
}
IceModule.registerPeer(new IceCredentials(var1.localUfrag, var1.localPassword), new IceCredentials(var1.remoteUfrag, var1.remotePassword), var2);
} else {
throw new IllegalArgumentException("ConfigureIcePeer carried malformed ICE credentials");
}
}
class="kw">public void handle(@Nonnull SetServerAccess var1) {
if (!Constants.SINGLEPLAYER) {
throw new IllegalArgumentException("SetServerAccess can only be used in singleplayer!");
}
if (!SingleplayerModule.isOwner(this.playerRef)) {
throw new IllegalArgumentException("SetServerAccess can only be used by the owner of the singleplayer world!");
}
HytaleServerConfig var2 = HytaleServer.get().getConfig();
if (var2 != null) {
var2.setPassword(var1.password != null ? var1.password : "");
HytaleServerConfig.save(var2);
}
SingleplayerModule.get().requestServerAccess(var1.access);
}
class="kw">public void handle(@Nonnull RequestMachinimaActorModel var1) {
ModelAsset var2 = ModelAsset.getAssetMap().getAsset(var1.modelId);
if (var2 != null) {
this.writeNoCache(new SetMachinimaActorModel(Model.createUnitScaleModel(var2).toPacket(), var1.sceneName, var1.actorName));
}
}
class="kw">public void handleUpdateMachinimaScene(
@Nonnull UpdateMachinimaScene var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
}
class="kw">public void handle(@Nonnull ClientReady var1) {
HytaleLogger.getLogger().at(Level.WARNING).log("%s: Received %s", this.getIdentifier(), var1);
CompletableFuture var2 = this.clientReadyForChunksFuture;
if (var1.readyForChunks && !var1.readyForGameplay && var2 != null) {
this.clientReadyForChunksFutureStack = null;
this.clientReadyForChunksFuture = null;
var2.completeAsync(() -> null);
}
if (var1.readyForGameplay) {
Ref var3 = this.playerRef.getReference();
if (var3 == null || !var3.isValid()) {
class="kw">return;
}
Store var4 = var3.getStore();
World var5 = var4.getExternalData().getWorld();
var5.execute(() -> {
if (var3.isValid()) {
Player var3 = var4.getComponent(var3, Player.getComponentType());
assert var3 != null;
if (var3.isWaitingForClientReady()) {
TransformComponent var4 = var4.getComponent(var3, TransformComponent.getComponentType());
assert var4 != null;
HeadRotation var5 = var4.getComponent(var3, HeadRotation.getComponentType());
Rotation3f var6 = var5 != null ? var5.getRotation() : var4.getRotation();
TeleportSystems.queueAndSendClientTeleport(this.playerRef, var4.getPosition(), var4.getRotation(), var6, true);
if (this.playerRef.getTeleportAckTracker().isEmpty()) {
TeleportSystems.completeTeleport(var3, var4, var3, null);
} else {
var4.ensureAndGetComponent(var3, PendingTeleport.getComponentType());
}
}
var3.handleClientReady(false);
}
});
}
}
class="kw">public void handleUpdateWorldMapVisible(
@Nonnull UpdateWorldMapVisible var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
Player var6 = var5.getComponent(var3, Player.getComponentType());
assert var6 != null;
}
class="kw">public void handleTeleportToWorldMapMarker(
@Nonnull TeleportToWorldMapMarker var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
Player var6 = var5.getComponent(var3, Player.getComponentType());
assert var6 != null;
WorldMapTracker var7 = var6.getWorldMapTracker();
if (!var7.isAllowTeleportToMarkers(var2, var6)) {
var2.sendMessage(Message.translation("server.general.disconnect.teleportToMarkersNotAllowed"));
} else {
MapMarker var8 = var7.getSentMarkers().get(var1.id);
if (var8 != null) {
Transform var9 = PositionUtil.toTransform(var8.transform);
if (MapMarkerUtils.isUserMarker(var8)) {
int var10 = (int)var9.getPosition().x();
int var11 = (int)var9.getPosition().z();
WorldChunk var12 = var4.getChunk(ChunkUtil.indexChunkFromBlock(var10, var11));
int var13 = var12 == null ? 319 : var12.getHeight(var10, var11);
var9.getPosition().y = var13;
}
Teleport var14 = Teleport.createForPlayer(var9);
var4.getEntityStore().getStore().addComponent(var2.getReference(), Teleport.getComponentType(), var14);
}
}
}
class="kw">public void handleTeleportToWorldMapPosition(
@Nonnull TeleportToWorldMapPosition var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
Player var6 = var5.getComponent(var3, Player.getComponentType());
assert var6 != null;
if (!WorldMapTracker.isAllowTeleportToCoordinates(var2, var6)) {
var2.sendMessage(Message.translation("server.general.disconnect.teleportToCoordinatesNotAllowed"));
} else {
var4.getChunkStore().getChunkReferenceAsync(ChunkUtil.indexChunkFromBlock(var1.x, var1.y), 32).thenAcceptAsync(var2x -> {
if (var3.isValid()) {
Store var3 = var3.getStore();
Store var4 = var2x.getStore();
BlockChunk var5 = var4.getComponent((Ref<ChunkStore>)var2x, BlockChunk.getComponentType());
assert var5 != null;
Vector3d var6 = new Vector3d(var1.x, var5.getHeight(var1.x, var1.y) + 2, var1.y);
HeadRotation var7 = var3.getComponent(var3, HeadRotation.getComponentType());
Rotation3fc var8 = var7 != null ? var7.getRotation() : Rotation3f.ZERO;
Teleport var9 = Teleport.createForPlayer(null, var6, var8);
var3.addComponent(var3, Teleport.getComponentType(), var9);
}
}, var4);
}
}
class="kw">public void handleCreateUserMarker(
@Nonnull CreateUserMarker var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
WorldMapManager var6 = var4.getWorldMapManager();
var6.handleUserCreateMarker(var2, var1);
}
class="kw">public void handle(@Nonnull SyncInteractionChains var1) {
int var2 = 1000 - this.interactionPacketQueue.size();
int var3 = Math.clamp(var2, 0, var1.updates.length);
this.interactionPacketQueue.addAll(Arrays.asList(var1.updates).subList(0, var3));
if (var3 < var1.updates.length) {
int var4 = var1.updates.length - var3;
HytaleLogger.getLogger()
.at(Level.WARNING)
.log(
"Dropped %d interaction updates from %s (queue full at %d)",
var4,
this.playerRef != null ? this.playerRef.getUuid() : "unknown",
this.interactionPacketQueue.size()
);
for (int var5 = var3; var5 < var1.updates.length; var5++) {
SyncInteractionChain var6 = var1.updates[var5];
if (var6.initial) {
this.write(new CancelInteractionChain(var6.chainId, var6.forkedId));
}
}
}
}
class="kw">public void handleMountMovement(
@Nonnull MountMovement var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
Player var6 = var5.getComponent(var3, Player.getComponentType());
assert var6 != null;
if (var6 != null) {
Ref var7 = var4.getEntityStore().getRefFromNetworkId(var6.getMountEntityId());
if (var7 != null && var7.isValid()) {
TransformComponent var8 = var5.getComponent(var7, TransformComponent.getComponentType());
assert var8 != null;
if (var8 != null) {
var8.setPosition(PositionUtil.toVector3d(var1.absolutePosition));
var8.setRotation(PositionUtil.toRotation(var1.bodyOrientation));
MovementStatesComponent var9 = var5.getComponent(var7, MovementStatesComponent.getComponentType());
assert var9 != null;
if (var9 != null) {
var9.setMovementStates(var1.movementStates);
}
}
}
}
}
class="kw">public void handlePlayEmote(
@Nonnull PlayEmote var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
if (var1.emoteId != null && !var1.emoteId.isEmpty()) {
if (!var5.getArchetype(var3).contains(PreventEmotes.getComponentType())) {
Map var6 = CosmeticsModule.get().getRegistry().getEmotesInGame();
if (var6.get(var1.emoteId) != null || EmoteAsset.getAssetMap().getAsset(var1.emoteId) != null) {
AnimationUtils.playAnimation(var3, AnimationSlot.Emote, null, var1.emoteId, true, var5);
}
}
} else {
AnimationUtils.stopAnimation(var3, AnimationSlot.Emote, true, var5);
}
}
class="kw">public void handleSetPaused(
@Nonnull SetPaused var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
if (var4.getPlayerCount() == 1 && Constants.SINGLEPLAYER) {
var4.setPaused(var1.paused);
}
}
class="kw">public void handleRequestFlyCameraMode(
@Nonnull RequestFlyCameraMode var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
if (var2.hasPermission(HytalePermissions.FLY_CAM)) {
this.writeNoCache(new SetFlyCameraMode(var1.entering));
if (var1.entering) {
var2.sendMessage(Message.translation("server.general.flyCamera.enabled"));
} else {
var2.sendMessage(Message.translation("server.general.flyCamera.disabled"));
}
} else {
var2.sendMessage(Message.translation("server.general.flyCamera.noPermission"));
}
}
class="kw">public void handleRequestNoClip(
@Nonnull RequestNoClip var1, @Nonnull PlayerRef var2, @Nonnull Ref<EntityStore> var3, @Nonnull World var4, @Nonnull Store<EntityStore> var5
) {
Player var6 = var5.getComponent(var3, Player.getComponentType());
assert var6 != null;
if (GameModeTypeState.isNoClipForced(var3, var5)) {
if (!var6.isNoClip()) {
var6.setNoClip(var3, true, var1.notify, var5);
}
} else {
boolean var7 = var1.enabled && var2.hasPermission(HytalePermissions.NO_CLIP);
if (var6.isNoClip() != var7) {
var6.setNoClip(var3, var7, var1.notify, var5);
}
}
}
}