open_game_finder.adoc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. = Open Game Finder
  2. :author:
  3. :revnumber:
  4. :revdate: 2016/03/17 20:48
  5. :keywords: network
  6. :relfileprefix: ../../
  7. :imagesdir: ../..
  8. ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  9. 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.
  10. * Homepage: link:https://code.google.com/archive/p/open-game-finder/[https://code.google.com/archive/p/open-game-finder/]
  11. * Documentation: link:https://code.google.com/archive/p/open-game-finder/w/list[https://code.google.com/archive/p/open-game-finder/w/list]
  12. 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 +++<abbr title="Graphical User Interface">GUI</abbr>+++ plugin.
  13. == Installation
  14. . Go to link:https://code.google.com/archive/p/open-game-finder/downloads/list[https://code.google.com/archive/p/open-game-finder/downloads/list]
  15. . Download Client-1.0-bin.zip and Server-1.0-bin.zip
  16. . Unzip the two files to, for example, your jMonkeyProjects directory.
  17. == Setting up the Database
  18. 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.
  19. * On Windows, use installServer.bat to create a new database from scratch. On Mac +++<abbr title="Operating System">OS</abbr>+++ or Linux, run `java -jar lib/Server-0.1.jar install` in the Terminal.
  20. * On Windows, use updateServer.bat to update the difference between the current state of the database and the way it should be. On Mac +++<abbr title="Operating System">OS</abbr>+++ and Linux, run `java -jar lib/Server-0.1.jar update` in the Terminal. +*This new feature is currently untested.*
  21. == Running the server
  22. Change into the OGF-Server directory and run the server:
  23. * On Windows: Run startServer.bat
  24. * On Linux and MacOS X: Run `java -jar lib/Server-1.0.jar` in the Terminal.
  25. The server is now running and ready to accept connections. +
  26. *Note:* In the alpha release, the server runs on localhost. In the final release, you will be able to configure the host!
  27. == Running the client
  28. . Change into the OGF-Client directory and run the client:
  29. ** On Windows: Run startClient.bat
  30. ** On Linux and MacOS X: Run `java -jar lib/Client-1.0.jar` in the Terminal.
  31. . If a Display Settings window appears, you can keep the defaults and click OK.
  32. A client is now running, connects to the server, and displays a registration/login window.
  33. image::jme3/advanced/open-game-finder-1.png[open-game-finder-1.png,width="",height="",align="center"]
  34. *Note:* You can run several clients on localhost for testing.
  35. === Client: 1. Registration
  36. If clients use OGF for the first time, they need to register.
  37. On the main screen of the client:
  38. . Click Register
  39. . Choose a user name and password (repeat the password).
  40. . Select an Avatar image.
  41. . Click register to complete the registration.
  42. The client registers the account and opens the chat window directly.
  43. === Client: 2. Login
  44. If returning clients are already registered to an OGF server, they can log in.
  45. On the main screen of the client:
  46. . Enter a user name and password that you previously registered.
  47. . Click Login
  48. The client logs you in and opens the chat window.
  49. === Client: 3. Chat
  50. 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.
  51. == Connecting to a Game
  52. Q: I want to gather players using the OGF client to connect to the game server. How do I start my multiplayer game? +
  53. A: The following sample code demos the typical use case: link:https://code.google.com/archive/p/open-game-finder/source/browse/OGF/TRUNK/Client/src/main/java/com/ractoc/opengamefinder/client/OGFClientStartup.java[OGFClientStartup.java]
  54. +
  55. In a JME3 Application's init method:
  56. . Create a com.ractoc.opengamefinder.client.GUIContainer object.
  57. . Create a game instance using the GUIContainer (via a ClientFactory).
  58. . Check the com.ractoc.pffj.api.BasePluginMessageResult for success or failure.
  59. After this, continue writing your JME3 init method.
  60. == Configuration
  61. * Q: How can I offer more avatars to choose from? +A: Save the image files in the path `jMonkeyProjects/OGF-Client-1.0-bin/OGF/resources/avatars/`
  62. * Q: How do I configure servers addresses? +A: TBD