tutorial:side
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:side [2019/05/26 14:51] – [Logical Sides] Made logical sides more about the world state and the replication jamieswhiteshirt | tutorial:side [2019/05/26 15:32] – [Side] Put client and server in quotes when disambiguating the different types of sides jamieswhiteshirt | ||
---|---|---|---|
Line 4: | Line 4: | ||
In the past, there used to be a simple division into the client and the server, but with the switch of the single player game mode to an internal dedicated server, this simple model doesn' | In the past, there used to be a simple division into the client and the server, but with the switch of the single player game mode to an internal dedicated server, this simple model doesn' | ||
- | For both types of sides, there are client and server. However, a logical client is not equivalent to a physical client, and a logical server is not equivalent to a physical server either. A logical client is instead **hosted by** a physical client, and a logical server is hosted by either a physical server or a physical client. | + | For both types of sides, there is a 'client' |
The logical sides are central in the architecture of both distributions of Minecraft. Therefore, an understanding of logical sides is vital for any mod development with Fabric. | The logical sides are central in the architecture of both distributions of Minecraft. Therefore, an understanding of logical sides is vital for any mod development with Fabric. | ||
Line 62: | Line 62: | ||
==== Logical Server ==== | ==== Logical Server ==== | ||
- | The logical server is where most of the game logic is going on. Data packs, world updates, block entity and entity ticks, mob AI, game/world saving, | + | The logical server is where most of the game logic is executed. Data packs, world updates, block entity and entity ticks, mob AI, game/world saving, |
The logical server on the physical client is called the " | The logical server on the physical client is called the " | ||
- | The logical server | + | The logical server runs in its own main thread, even on physical servers, |
- | + | ||
- | Most universal mods target the logical server so that they can work on physical sides. | + | |
+ | Most universal mods target the logical server so that they can work both in single player and multi player scenarios. | ||
===== Communication===== | ===== Communication===== | ||
- | The only correct way to exchange data between | + | The only correct way to exchange data between |
Logical clients send C2S (Client-To-Server) packets to the logical server. | Logical clients send C2S (Client-To-Server) packets to the logical server. | ||
The logical server sends S2C (Server-To-Client) packets the logical clients. | The logical server sends S2C (Server-To-Client) packets the logical clients. | ||
- | Packets are sent be a write method in a network thread and received by a call to a read method in a network thread. | + | Packets are sent by a write method in a network thread and received by a call to a read method in a network thread. |
For more details on how to handle networking, see [[tutorial: | For more details on how to handle networking, see [[tutorial: |
tutorial/side.txt · Last modified: 2022/04/13 04:32 by 127.0.0.1