open_game_finder.html 9.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="Asciidoctor 1.5.4"><meta name="keywords" content="network"><title>Open Game Finder</title><link rel="stylesheet" href="./asciidoctor.css">
  2. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
  3. <link rel="stylesheet" href="./coderay-asciidoctor.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css"><link rel="stylesheet" href="/home/travis/build/jMonkeyEngine/wiki/build/asciidoc/html5/jme3/advanced/twemoji-awesome.css"></head><body class="article toc2 toc-left"><div id="header"><div id="toolbar"><a href="https://github.com/jMonkeyEngine/wiki/edit/master/src/docs/asciidoc/jme3/advanced/open_game_finder.adoc"><i class="fa fa-pencil-square" aria-hidden="true"></i></a><a href="https://github.com/jMonkeyEngine/wiki/new/master/src/docs/asciidoc/jme3/advanced/"><i class="fa fa-plus-square" aria-hidden="true"></i></a><input dir="auto" style="position: relative; vertical-align: top;" spellcheck="false" autocomplete="off" class="searchbox__input aa-input" id="doc-search" name="search" placeholder="Search in the doc" required="required" type="search"></div><h1>Open Game Finder</h1><div class="details"><span class="author" id="author"></span><br><span id="revnumber">version ,</span> <span id="revdate">2016/03/17 20:48</span></div><div id="toc" class="toc2"><div id="toctitle">Table of Contents</div><ul class="sectlevel1"><li><a href="#installation">Installation</a></li><li><a href="#setting-up-the-database">Setting up the Database</a></li><li><a href="#running-the-server">Running the server</a></li><li><a href="#running-the-client">Running the client</a><ul class="sectlevel2"><li><a href="#client-1-registration">Client: 1. Registration</a></li><li><a href="#client-2-login">Client: 2. Login</a></li><li><a href="#client-3-chat">Client: 3. Chat</a></li></ul></li><li><a href="#connecting-to-a-game">Connecting to a Game</a></li><li><a href="#configuration">Configuration</a></li></ul></div></div><div id="content"><div id="preamble"><div class="sectionbody"><div class="paragraph"><p>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.</p></div>
  4. <div class="ulist"><ul><li><p>Homepage: <a href="http://code.google.com/p/open-game-finder/">http://code.google.com/p/open-game-finder/</a></p></li><li><p>Documentation: <a href="http://code.google.com/p/open-game-finder/w/list">http://code.google.com/p/open-game-finder/w/list</a></p></li></ul></div>
  5. <div class="paragraph"><p>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.</p></div></div></div>
  6. <div class="sect1"><h2 id="installation">Installation</h2><div class="sectionbody"><div class="olist arabic"><ol class="arabic"><li><p>Go to <a href="http://code.google.com/p/open-game-finder/downloads/list">http://code.google.com/p/open-game-finder/downloads/list</a></p></li><li><p>Download Client-1.0-bin.zip and Server-1.0-bin.zip</p></li><li><p>Unzip the two files to, for example, your jMonkeyProjects directory.</p></li></ol></div></div></div>
  7. <div class="sect1"><h2 id="setting-up-the-database">Setting up the Database</h2><div class="sectionbody"><div class="paragraph"><p>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.</p></div>
  8. <div class="ulist"><ul><li><p>On Windows, use installServer.bat to create a new database from scratch. On Mac <abbr title="Operating System">OS</abbr> or Linux, run <code>java -jar lib/Server-0.1.jar install</code> in the Terminal.</p></li><li><p>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 <code>java -jar lib/Server-0.1.jar update</code> in the Terminal. +<strong>This new feature is currently untested.</strong></p></li></ul></div></div></div>
  9. <div class="sect1"><h2 id="running-the-server">Running the server</h2><div class="sectionbody"><div class="paragraph"><p>Change into the OGF-Server directory and run the server:</p></div>
  10. <div class="ulist"><ul><li><p>On Windows: Run startServer.bat</p></li><li><p>On Linux and MacOS X: Run <code>java -jar lib/Server-1.0.jar</code> in the Terminal.</p></li></ul></div>
  11. <div class="paragraph"><p>The server is now running and ready to accept connections.<br>
  12. <strong>Note:</strong> In the alpha release, the server runs on localhost. In the final release, you will be able to configure the host!</p></div></div></div>
  13. <div class="sect2"><h3 id="running-the-client">Running the client</h3><div class="olist arabic"><ol class="arabic"><li><p>Change into the OGF-Client directory and run the client:</p><div class="ulist"><ul><li><p>On Windows: Run startClient.bat</p></li><li><p>On Linux and MacOS X: Run <code>java -jar lib/Client-1.0.jar</code> in the Terminal.</p></li></ul></div></li><li><p>If a Display Settings window appears, you can keep the defaults and click OK.</p></li></ol></div>
  14. <div class="paragraph"><p>A client is now running, connects to the server, and displays a registration/login window.</p></div>
  15. <div style="text-align: center;" class="imageblock"><div class="content"><img src="../../jme3/advanced/open-game-finder-1.png" alt="open-game-finder-1.png" width="" height=""></div></div>
  16. <div class="paragraph"><p><strong>Note:</strong> You can run several clients on localhost for testing.</p></div>
  17. <div class="sect2"><h3 id="client-1-registration">Client: 1. Registration</h3><div class="paragraph"><p>If clients use OGF for the first time, they need to register.
  18. On the main screen of the client:</p></div>
  19. <div class="olist arabic"><ol class="arabic"><li><p>Click Register</p></li><li><p>Choose a user name and password (repeat the password).</p></li><li><p>Select an Avatar image.</p></li><li><p>Click register to complete the registration.</p></li></ol></div>
  20. <div class="paragraph"><p>The client registers the account and opens the chat window directly.</p></div></div>
  21. <div class="sect2"><h3 id="client-2-login">Client: 2. Login</h3><div class="paragraph"><p>If returning clients are already registered to an OGF server, they can log in.
  22. On the main screen of the client:</p></div>
  23. <div class="olist arabic"><ol class="arabic"><li><p>Enter a user name and password that you previously registered.</p></li><li><p>Click Login</p></li></ol></div>
  24. <div class="paragraph"><p>The client logs you in and opens the chat window.</p></div></div>
  25. <div class="sect2"><h3 id="client-3-chat">Client: 3. Chat</h3><div class="paragraph"><p>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.</p></div></div></div>
  26. <div class="sect1"><h2 id="connecting-to-a-game">Connecting to a Game</h2><div class="sectionbody"><div class="paragraph"><p>Q: I want to gather players using the OGF client to connect to the game server. How do I start my multiplayer game?<br>
  27. A: The following sample code demos the typical use case: <a href="http://code.google.com/p/open-game-finder/source/browse/OGF/TRUNK/Client/src/main/java/com/ractoc/opengamefinder/client/OGFClientStartup.java">OGFClientStartup.java</a></p></div>
  28. <div class="paragraph"><p>+
  29. In a JME3 Application&#8217;s init method:</p></div>
  30. <div class="olist arabic"><ol class="arabic"><li><p>Create a com.ractoc.opengamefinder.client.GUIContainer object.</p></li><li><p>Create a game instance using the GUIContainer (via a ClientFactory).</p></li><li><p>Check the com.ractoc.pffj.api.BasePluginMessageResult for success or failure.</p></li></ol></div>
  31. <div class="paragraph"><p>After this, continue writing your JME3 init method.</p></div></div></div>
  32. <div class="sect1"><h2 id="configuration">Configuration</h2><div class="sectionbody"><div class="ulist"><ul><li><p>Q: How can I offer more avatars to choose from? +A: Save the image files in the path <code>jMonkeyProjects/OGF-Client-1.0-bin/OGF/resources/avatars/</code></p></li><li><p>Q: How do I configure servers addresses? +A: TBD</p></li></ul></div></div></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2019-12-20 23:30:51 +00:00</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
  33. apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
  34. indexName: 'jmonkeyengine',
  35. inputSelector: '#doc-search',
  36. debug: false // Set debug to true if you want to inspect the dropdown
  37. });</script></body></html>