Version 4 (modified by scheusso, 16 years ago) (diff) |
---|
Network
Overview
The image below displays the basic concept of the Network Engine:
The basic jobs of the Network Engine are:
- Synchronise all objects of the universe between server and clients
- Provide a chatting mechanism
- Transmit all neccessary information about the players (nickname, score, …)
The server and client components manage all the other network components. They call all necessary functions every network tick (not exactly the same as a game tick).
Components
This is a description of the important network components and/or classes:
Component | Description | Classes included |
Host | Interface class of the Network Engine | Host, Server, Client, ClientInformation |
Gamestate? | Management of the object information to be synchronised | GamestateHandler, GamestateManager, GamestateClient |
Packet? | Management of the data to be transmitted | Packet, Acknowledgement, Chat, ClassID, DeleteObjects, Gamestate, Welcome |
Connection? | Management of the network connection between server and client | ConnectionManager, ClientConnection |
Synchronisable | Interface class for all network objects, that need synchronisation | Synchronisable |
External API
Synchronisable
The most important part of the Network API is the Synchronisable Class (see also Synchronisable):
- This class provides the functionality for objects to get synchronised over the network:
- REGISTERDATA/REGISTERSTRING: these functions register a variable (to the Network Engine) that needs synchronisation
- setObjectMode: this function sets the direction of synchronisation (server→client / server↔client / server←client)
- Every class that needs synchronisation must fullfill some dependencies:
- It must (public) inherit from Synchronisable
- It must have a default constructor
- All steps in object creation that need data (from the levelfile or the network) must be in the create() function
- It must implement the following functions:
- registerAllVariables: register all variables (currently only basic types and strings), that need synchronisation, to the network engine by calling REGISTERDATA and/or REGISTERSTRING
- create: (as described above)
Host
Attachments (2)
- conceptoverview.png (19.9 KB) - added by scheusso 16 years ago.
-
network_overview.png
(33.8 KB) -
added by varyo 7 years ago.
for internal overview of dataflow through network engine
Download all attachments as: .zip