$Date: 2005/10/28 14:26:23 $
$Revision: 1.65 $
-- Initialisation
-- Init
-- (From EM_DELAYED_PROCEDURES)
-- EiffelMedia network subsystem is
-- (From EM_SHARED_SUBSYSTEMS)
-- Last received packet
-- (From EM_UDP_SOCKET)
-- Returns reference to the singleton
-- (From EM_TIME_SINGLETON)
-- Subscribe a_procedure to an_event.
-- (From EM_NET_EVENT_PROCESSOR)
-- Subscribe a_procedure to an event with an_event_type_id.
-- (From EM_NET_EVENT_PROCESSOR)
-- Unsubscribe a_procedure from an_event.
-- (From EM_NET_EVENT_PROCESSOR)
-- Unsubscribe a_procedure from an event with an_event_type_id.
-- (From EM_NET_EVENT_PROCESSOR)
-- Add a_procedure which will be called in TIME_OFFSET miliseconds from "now" in the same thread!
-- Use the feature "process" to call all procedures whose time is up.
-- You could use EM_TIME_SINGLETON for global timing: The EM_EVENT_LOOP will call "process" each loop once.
-- You can also use the EM_EVENT_LOOP to have a per scene executeion.
-- (From EM_DELAYED_PROCEDURES)
-- executes all stored procedures whose time is up...
-- Make sure you don't add procedures which use a lot of computation time. Only small, short
-- procedures are appropriate. Otherwise use add_timed_callback which runs functions in a different thread
-- to avoid a laggy reaction to other events.
-- (From EM_DELAYED_PROCEDURES)
-- Send a_string to a_destination.
-- (From EM_UDP_SOCKET)
-- clear the whole "delayed procedure call" list (procedures added with add_procedure, executed with execute)
-- (From EM_DELAYED_PROCEDURES)
-- Handle a received packet.
-- (From EM_UDP_SOCKET)
-- Send failed event.
-- Passed parameter is the error code: Em_error_resolve_ip or Em_error_send_failed
-- (From EM_UDP_SOCKET)
-- Disable auto transmission.
-- Enable auto transmission of packets.
-- The mechanism tries to send packets with a frequency of net_fps.
-- Send updated objects for each group to clients.
-- Publish an_event to the standard group.
-- Event that is called if a connection timeout occurs
-- Create a connection and monitor it for timeouts.
-- Create a connection and don't monitor it for timeouts.
-- Use this for broadcasts and other cases where you have mainly outgoing traffic.
-- Delete a_connection.
-- Last created connection
-- Disable time synchronisation.
-- Enable time synchronisation.
-- Is time synchronisation enabled?
-- Time in milliseconds!
-- Group used for time synchronisation
-- Add an_object to the standard group.
-- Does the standard group contain an_object?
-- Remove an_object from the standard group.
-- Create a new group with a_group_name and make it available in last_created_group.
-- a_group_name must be unique.
-- Group with group_name
-- Does a_group exist?
-- Does group with a_group_name exist?
-- Last group that was created by create_group
-- Remove a_group.
-- Remove group with a_group_name.
-- Standard group
-- Many convenience features use this group
-- Add an_object to the list of synchronized objects.
-- Remove an_object from the list of synchronized objects.
-- Enable timed resend of an_event.
-- Handle client ACK messages.
-- List of pending 2PC events
-- The key of the hashtable is the event_id.
-- The value of the hashtable is the EVENT itself and the list of connections whose ACKs are not received yet.
-- Send an_event to clients that have not sent an acknowledgement yet.
-- Publish an_event to the event queue.
-- (From EM_NET_EVENT_PROCESSOR)
-- Set are_timed_procedures_paused to a_value
-- Use this to pause the procedure callbacks. This is really usefull if you want to pause a game!
-- However, this will not pause functions added with add_timed_callback.
-- (From EM_DELAYED_PROCEDURES)
-- ID manager for events
-- ID manager for net objects
-- Object creation factory
-- Game identifier
-- Is auto transmit enabled?
-- Use this to automate the sending of outgoing data.
-- This relies on the net_fps frequency.
-- Network updates per second
-- Object types which can be used in this implementation
-- List of groups
-- List of objects which are synchronized over the network
-- Connection which sent the last update
-- Are timed prcedures paused?
-- (From EM_DELAYED_PROCEDURES)
-- Handle data reveived event.
-- (From EM_SOCKET)
-- Handle send failed.
-- (From EM_UDP_SOCKET)
-- Socket id of Net2
-- (From EM_SOCKET)
-- pause started ticks
-- Used to compute a timedifference to implement pause mechanism.
-- (From EM_DELAYED_PROCEDURES)
-- list of procedures
-- (From EM_DELAYED_PROCEDURES)
Base class for network peers in a multiplayer environment.
This class is the core of the EM multiplayer framework and implements functionality that is not
bound to a specific peer architecture (like peer-to-peer or client-server).
EM_NET_BASE is a generic class. You need to specify a generic parameter that is a subclass
of EM_NET_OBJECT_TYPES in which you register your own network objects.
See EM_NET_OBJECT_TYPES for further details about how to register your own objects.
It is very important that each peer, whose implementation is not necessarily identical to remote peers,
uses the same concrete EM_NET_OBJECT_TYPES. In other words: The (concrete) generic type of every EM_NET_BASE
in a network must conform with all other participants.
EM_NET_BASE is itself an EM_UDP_SOCKET which is used for data sending and receiving over a UDP socket.
There are currently two implementations of EM_NET_BASE:
- EM_NET_SERVER
- EM_NET_CLIENT
Together they build a client-server architecture which is usually used for network games.
For further explanations about the application of those classes have a look at the corresponding
class description.
Note: It is probably not necessary to make (any?) changes to EM_NET_BASE if you want to use your own network
architecture. For example, it is possible to create a peer to peer system just by extending EM_NET_BASE.