The Open Game Finder (OGF) by Mark Schrijver can be plugged into any Java game. OGF enables you to find other people playing the same multiplayer game, and join them.
Both on the client and the server side of OGF is written purely in Java. OGF has a pluggable architecture and comes with a full set of plugins to get the job done. You can add your own plugins, or replace existing plugins to make them more in line with your game. OGF uses NiftyGUI as the main GUI plugin.
The OGF server uses an embedded Apache Derby database. You have to install the database, this means creating the data files and adding the tables. You can do this straight from the command line by running a script file.
java -jar lib/Server-0.1.jar install
in the Terminal.java -jar lib/Server-0.1.jar update
in the Terminal. Change into the OGF-Server directory and run the server:
java -jar lib/Server-1.0.jar
in the Terminal.
The server is now running and ready to accept connections.
Note: In the alpha release, the server runs on localhost. In the final release, you will be able to configure the host!
java -jar lib/Client-1.0.jar
in the Terminal.
A client is now running, connects to the server, and displays a registration/login window.
Note: You can run several clients on localhost for testing.
If clients use OGF for the first time, they need to register. On the main screen of the client:
The client registers the account and opens the chat window directly.
If returning clients are already registered to an OGF server, they can log in. On the main screen of the client:
The client logs you in and opens the chat window.
The chat window shows a list of all users logged in to the server. Logged-in users can send public messages, and can receive public messages from others.
Q: I want to gather players using the OGF client to connect to the game server. How do I start my multiplayer game?
A: The following sample code demos the typical use case:
In a JME3 Application's init method:
After this, continue writing your JME3 init method.
jMonkeyProjects/OGF-Client-1.0-bin/OGF/resources/avatars/