Networking (deprecated)

From FIFE development wiki
(Redirected from Networking(deprecated))
Jump to: navigation, search

This article is currently only a proposal

The features or design guidelines described in this article are only a proposal made by one or some persons. It has not been reviewed and ratified by the core development team yet. Feel free to add your personal opinion about them or make counter proposals.

Networking

This is trapdoors proposal for networking to be implemented in the FIFE engine core. It is only for client-based multiplayer games, and not persistent or server-based multiplayer games. It is written purely with BSD sockets (winsock in Windows).

Network Manager

The network manager is what is used to create multiplayer games. It acts as a network listener. The functions will be:

  • init - This will create the NetworkServer and NetworkClient.
  • getNetworkServer - This will return the NetworkServer
  • getNetworkClient - This will return the NetworkClient
  • update - This will listen for messages and connections
  • registerListener - This is where listeners are registered to hear network events
  • removeListener - This will remove an existing listener from hearing network events

Network Server

This class is for hosting a game, and it will have the following functions.

  • init - This will initialise the server.
  • start - This will start the server running. It returns whether it started successfully.
  • update - This listens for client messages
  • getIP - The IP the server is running on
  • getPort - The port the server is running on
  • numberOfClients - This will return the number of clients connected.

Network Client

This class will be used to connect to a server. It will have the following functions.

  • init - This will initialise the client, and take in the IP address of the server.
  • update - This listens for server messages
  • isConnected - This will return whether the client is connected to the server

Network Events

Coming soon.

Using Networking from python

  • The server must be started on the host, and all others only need create a client.
  • A network listener must first be inherited, and registered with the Network Manager.
  • Listening for msgReceived messages allows you to get Network Events.
Personal tools