Wiki

Clone wiki

GenericMultiplayerConnector / Quickstart

Quickstart Guide

These are step-by-step instructions on how to incorporate it into your project:-

  • Run the server GMCServer.jar, or decide to use the public server described below.
  • Add the GMCClient.jar to your project.
  • Add the IGameClient interface in a class in your game, and implement all the methods (or leave as empty stubs).
  • Create instance of ConnectorMain().
  • Call ConnectorMain.connect() to connect to the server
  • Call ConnectorMain.joinGame() to join a game.
  • Your game should now wait until all players have connected. You will know enough players have connected when "ConnectorMain.getGameStage() == GameStage.IN_PROGRESS". You can then start your game proper.
  • You can send data to other clients with any of the ConnectorMain.send...() methods. All the other clients will automatically receive any data sent using the corresponding "IGameClient.ReceivedBy...()" interface methods.

Updated