docs: update documentation; patch ChangeActiveSlotInteraction
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# Networking and Protocol
|
||||
|
||||
The Hytale server uses a packet-based networking system for client-server communication. This guide covers the protocol system, packet types, and how to work with networking in your mods.
|
||||
The Hytale server uses a packet-based networking system for client-server communication. This guide covers the protocol
|
||||
system, packet types, and how to work with networking in your mods.
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -15,36 +16,36 @@ The networking layer is built on QUIC protocol and handles:
|
||||
|
||||
## Key Components
|
||||
|
||||
| Component | Description |
|
||||
|-----------|-------------|
|
||||
| `Packet` | Base interface for all packets |
|
||||
| `PacketRegistry` | Central packet type registration |
|
||||
| `PacketHandler` | Manages client connections and packet processing |
|
||||
| `ServerManager` | Server network manager |
|
||||
| Component | Description |
|
||||
|------------------|--------------------------------------------------|
|
||||
| `Packet` | Base interface for all packets |
|
||||
| `PacketRegistry` | Central packet type registration |
|
||||
| `PacketHandler` | Manages client connections and packet processing |
|
||||
| `ServerManager` | Server network manager |
|
||||
|
||||
## Packet Categories
|
||||
|
||||
Packets are organized into categories in `com.hypixel.hytale.protocol.packets`:
|
||||
|
||||
| Category | Description |
|
||||
|----------|-------------|
|
||||
| `connection/` | Connection lifecycle (connect, disconnect, ping) |
|
||||
| `auth/` | Authentication and session management |
|
||||
| `player/` | Player-specific packets (movement, actions) |
|
||||
| `entities/` | Entity creation, updates, removal |
|
||||
| `world/` | World/chunk data streaming |
|
||||
| `inventory/` | Inventory operations |
|
||||
| `interaction/` | Player interactions |
|
||||
| `interface_/` | UI/interface packets |
|
||||
| `camera/` | Camera control |
|
||||
| `setup/` | Initial setup and configuration |
|
||||
| `window/` | Window/container management |
|
||||
| `assets/` | Asset loading and management |
|
||||
| `asseteditor/` | Asset editor tools (dev) |
|
||||
| `buildertools/` | Building tools |
|
||||
| `machinima/` | Machinima/cinematic tools |
|
||||
| `serveraccess/` | Server access control |
|
||||
| `worldmap/` | World map data |
|
||||
| Category | Description |
|
||||
|-----------------|--------------------------------------------------|
|
||||
| `connection/` | Connection lifecycle (connect, disconnect, ping) |
|
||||
| `auth/` | Authentication and session management |
|
||||
| `player/` | Player-specific packets (movement, actions) |
|
||||
| `entities/` | Entity creation, updates, removal |
|
||||
| `world/` | World/chunk data streaming |
|
||||
| `inventory/` | Inventory operations |
|
||||
| `interaction/` | Player interactions |
|
||||
| `interface_/` | UI/interface packets |
|
||||
| `camera/` | Camera control |
|
||||
| `setup/` | Initial setup and configuration |
|
||||
| `window/` | Window/container management |
|
||||
| `assets/` | Asset loading and management |
|
||||
| `asseteditor/` | Asset editor tools (dev) |
|
||||
| `buildertools/` | Building tools |
|
||||
| `machinima/` | Machinima/cinematic tools |
|
||||
| `serveraccess/` | Server access control |
|
||||
| `worldmap/` | World map data |
|
||||
|
||||
## Packet Structure
|
||||
|
||||
@@ -163,45 +164,45 @@ for (Player player : Universe.get().getPlayers()) {
|
||||
|
||||
### Connection Packets
|
||||
|
||||
| Packet | Direction | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `ConnectionRequestPacket` | C->S | Client requests connection |
|
||||
| `ConnectionResponsePacket` | S->C | Server accepts/rejects connection |
|
||||
| `DisconnectPacket` | Both | Connection termination |
|
||||
| `PingPacket` | Both | Latency measurement |
|
||||
| Packet | Direction | Description |
|
||||
|----------------------------|-----------|-----------------------------------|
|
||||
| `ConnectionRequestPacket` | C->S | Client requests connection |
|
||||
| `ConnectionResponsePacket` | S->C | Server accepts/rejects connection |
|
||||
| `DisconnectPacket` | Both | Connection termination |
|
||||
| `PingPacket` | Both | Latency measurement |
|
||||
|
||||
### Player Packets
|
||||
|
||||
| Packet | Direction | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `PlayerPositionPacket` | Both | Position update |
|
||||
| `PlayerInputPacket` | C->S | Player input (movement, actions) |
|
||||
| `PlayerActionPacket` | C->S | Player actions |
|
||||
| Packet | Direction | Description |
|
||||
|------------------------|-----------|----------------------------------|
|
||||
| `PlayerPositionPacket` | Both | Position update |
|
||||
| `PlayerInputPacket` | C->S | Player input (movement, actions) |
|
||||
| `PlayerActionPacket` | C->S | Player actions |
|
||||
|
||||
### Entity Packets
|
||||
|
||||
| Packet | Direction | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `EntitySpawnPacket` | S->C | Entity creation |
|
||||
| `EntityUpdatePacket` | S->C | Entity state update |
|
||||
| `EntityRemovePacket` | S->C | Entity removal |
|
||||
| `EntityMovePacket` | S->C | Entity movement |
|
||||
| Packet | Direction | Description |
|
||||
|----------------------|-----------|---------------------|
|
||||
| `EntitySpawnPacket` | S->C | Entity creation |
|
||||
| `EntityUpdatePacket` | S->C | Entity state update |
|
||||
| `EntityRemovePacket` | S->C | Entity removal |
|
||||
| `EntityMovePacket` | S->C | Entity movement |
|
||||
|
||||
### World Packets
|
||||
|
||||
| Packet | Direction | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `ChunkDataPacket` | S->C | Chunk data transfer |
|
||||
| `BlockChangePacket` | S->C | Block state change |
|
||||
| `WorldTimePacket` | S->C | World time sync |
|
||||
| Packet | Direction | Description |
|
||||
|---------------------|-----------|---------------------|
|
||||
| `ChunkDataPacket` | S->C | Chunk data transfer |
|
||||
| `BlockChangePacket` | S->C | Block state change |
|
||||
| `WorldTimePacket` | S->C | World time sync |
|
||||
|
||||
### Inventory Packets
|
||||
|
||||
| Packet | Direction | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `InventoryUpdatePacket` | S->C | Inventory contents |
|
||||
| `SlotChangePacket` | Both | Single slot update |
|
||||
| `ItemPickupPacket` | S->C | Item pickup notification |
|
||||
| Packet | Direction | Description |
|
||||
|-------------------------|-----------|--------------------------|
|
||||
| `InventoryUpdatePacket` | S->C | Inventory contents |
|
||||
| `SlotChangePacket` | Both | Single slot update |
|
||||
| `ItemPickupPacket` | S->C | Item pickup notification |
|
||||
|
||||
## Rate Limiting
|
||||
|
||||
@@ -284,12 +285,12 @@ player.closeUI();
|
||||
|
||||
### UI Packets
|
||||
|
||||
| Packet | Direction | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `UIOpenPacket` | S->C | Open a UI screen |
|
||||
| `UIClosePacket` | S->C | Close UI |
|
||||
| `UIUpdatePacket` | S->C | Update UI data |
|
||||
| `UIInteractionPacket` | C->S | UI button/element interaction |
|
||||
| Packet | Direction | Description |
|
||||
|-----------------------|-----------|-------------------------------|
|
||||
| `UIOpenPacket` | S->C | Open a UI screen |
|
||||
| `UIClosePacket` | S->C | Close UI |
|
||||
| `UIUpdatePacket` | S->C | Update UI data |
|
||||
| `UIInteractionPacket` | C->S | UI button/element interaction |
|
||||
|
||||
## Network Compression
|
||||
|
||||
|
||||
Reference in New Issue
Block a user