Difference between revisions of "Networking"

From Forge Community Wiki
(Inital Import dokuwiki)
 
m (SciWhiz12 moved page Networking to Networking: remove the "Understanding" part)
 
(2 intermediate revisions by one other user not shown)
Line 3: Line 3:
 
Read an [[Understanding Networking#overview|overview]] of why networking matters and the basic strategies in thinking about networking.
 
Read an [[Understanding Networking#overview|overview]] of why networking matters and the basic strategies in thinking about networking.
  
There are a variety of techniques provided by Forge to facilitate communication - mostly built on top of [[https://netty.io|netty]].
+
There are a variety of techniques provided by Forge to facilitate communication - mostly built on top of [https://netty.io netty].
  
The simplest, for a new mod, would be [[latest:advanced:networking:simplechannel|SimpleImpl]], where most of the complexity of the netty system is
+
The simplest, for a new mod, would be [[Using SimpleChannel|SimpleImpl]], where most of the complexity of the netty system is
 
abstracted away. It uses a message and handler style system.
 
abstracted away. It uses a message and handler style system.
  
Line 12: Line 12:
 
There are two primary goals in network communication:
 
There are two primary goals in network communication:
  
1. Making sure the client view is "in sync" with the server view
+
# Making sure the client view is "in sync" with the server view
## The flower at coordinates X, Y, Z just grew
+
#* The flower at coordinates X, Y, Z just grew
2. Giving the client a way to tell the server that something has changed about the player
+
# Giving the client a way to tell the server that something has changed about the player
## the player pressed a key
+
#* the player pressed a key
  
 
The most common way to accomplish these goals is to pass messages between the client and the server. These messages will
 
The most common way to accomplish these goals is to pass messages between the client and the server. These messages will
 
usually be structured, containing data in a particular arrangement, for easy sending and receiving.
 
usually be structured, containing data in a particular arrangement, for easy sending and receiving.

Latest revision as of 05:08, 11 January 2021

Communication between servers and clients is the backbone of a successful mod implementation.

Read an overview of why networking matters and the basic strategies in thinking about networking.

There are a variety of techniques provided by Forge to facilitate communication - mostly built on top of netty.

The simplest, for a new mod, would be SimpleImpl, where most of the complexity of the netty system is abstracted away. It uses a message and handler style system.

Overview

There are two primary goals in network communication:

  1. Making sure the client view is "in sync" with the server view
    • The flower at coordinates X, Y, Z just grew
  2. Giving the client a way to tell the server that something has changed about the player
    • the player pressed a key

The most common way to accomplish these goals is to pass messages between the client and the server. These messages will usually be structured, containing data in a particular arrangement, for easy sending and receiving.