Networking (deprecated)

From FIFE development wiki
Revision as of 15:58, 1 June 2012 by Prock (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This article is outdated and is just stored for archive purposes. Archived.png

This article became outdated and is just stored for archive purposes in this wiki. There are several reasons why an article could become outdated. The development team may have decided to use a different concept or even the author itself felt that the article is not really up-to-date with the current development status of the project anymore.


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.