12.07.2015 Views

Implementation of a Peer-to-Peer Multiplayer Game with ... - DVS

Implementation of a Peer-to-Peer Multiplayer Game with ... - DVS

Implementation of a Peer-to-Peer Multiplayer Game with ... - DVS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Output is the archive file libcusp.a. The corresponding C header file is generated as libcusp.h. As the CAPI is inconvenient <strong>to</strong> use, C++ wrapper classes provide an API that is similar <strong>to</strong> the original StandardML API. Thus, applications should always use the C++ header file cusp.h.planetp4v2planetp4v2 is a CMake project. Using the cmake command you can generate either Unix makefiles or setup a project for a common IDE like Micros<strong>of</strong>t Visual Studio, CodeBlocks, Eclipse CDT, or KDevelop. Forjust building the project, it is recommended <strong>to</strong> create a makefile and execute it:cd planetp4v2cmake .makeIf successful, this will generate the executable planetp4 and the archive for the simula<strong>to</strong>r libplanetp4sim.a.Depending on the location <strong>of</strong> the BubbleS<strong>to</strong>rm sources, the CMake project description file, CMake-Lists.txt, has <strong>to</strong> be adapted. The lineSET(TRANSPORT_DIR )specifies the (absolute or relative) path <strong>to</strong> the cbindings direc<strong>to</strong>ry, e.g.SET(TRANSPORT_DIR ../../BubbleS<strong>to</strong>rm/Middleware/cusp/cbindings)Simula<strong>to</strong>rThe Simula<strong>to</strong>r build uses the libplanetp4sim.a and links it against the simula<strong>to</strong>r core and setup code. Forbuilding the simula<strong>to</strong>r there is a makefile, as usual.cd planetp4v2/simula<strong>to</strong>rmakeSimilarly <strong>to</strong> the CMake project, the makefile contains the variable TRANSPORT_DIR specifying thelocation <strong>of</strong> the cbindings, e.g.TRANSPORT_DIR=../../../BubbleS<strong>to</strong>rm/Middleware/cusp/cbindings4.5.3 Command Line ParametersThe planetp4 executable can run in client, server, and peer-<strong>to</strong>-peer mode as selected by command lineswitches. All available command line options are listed in the following table:Option Description Default-m, --mode Selects the networking mode. Available modes are p2p, p2pcuspserver, cuspclient, tcpserver, and tcpclient.-b, --bind-port Local UDP bind port number. 8585-s, --server Server or gateway peer address. -p, --server-port Server or gateway peer port number. 8585-c, --console Disables 3D rendering and runs the game in console mode. -a, --ai Enables AI player control (bot mode). -t, --terminate Terminates the game after the given number <strong>of</strong> milliseconds.4 <strong>Implementation</strong> 65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!