Namazu Crossfire is currently distributed as separate Element, which means you must install it separately. We publish stable releases to Maven Central and therefore you can simply include Crossfire as a dependency in your game’s Custom Code. Namazu Crossfire implements a single WebSocket endpoint which will handle the real time matchmaking process.
Prerequisites #
π Note
Starting with Namazu Crossfire 1.0.4 and later, the element artifact has been renamed to server with the Classifier element
<dependency>
<groupId>dev.getelements.elements.crossfire</groupId>
<artifactId>server</artifactId>
<version>${crossfire.version}</version>
<classifier>element</classifier>
<scope>provided</scope>
</dependency>
- This guide assumes you have already completed the steps required to establish an application configuration for Matchmaking. If you haven’t already done so, please work through the process of Creating a Matchmaking Application Configuration
- You have sufficient access to publish Custom Code to your instance of Namazu Elements.
- You have reviewed or are familiar with making a Custom Element. Reviewing the Example Code is a great place to start.
- You have completed the steps necessary to setup your local environment and have git installed.
Local Development in IDE #
It is possible to run Namazu Crossfire directly in your local IDE along side your game’s custom Element. This enables you to rapidly iterate on development cycles without needing to push to the cloud. Additionally, you can step through and debug any additional endpoint code.
Automatic Method #
The latest Element Example project incorporates Namazu Crossfire right out of the box as of the 3.4 release. However, it must be enabled by activating the profile to include it as a dependency.
<profiles>
<profile>
<id>namazu-crossfire</id>
<activation>
- <activeByDefault>false</activeByDefault>
+ <activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>dev.getelements.elements.crossfire</groupId>
<artifactId>element</artifactId>
<version>${crossfire.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
By changing <activeByDefault> to true and rebuilding the project, you have enabled Namazu Crossfire in your local environment.
π Note
It is sometimes necessary to clean the build before running as re-running local does not always immediately clean up the classpath. Cleaning the build guarantees a complete rebuild of the element path.
mvn clean
Manual Method #
This guide is here to incorporate Crossfire into an existing game.
1. Changes to <dependencies> in pom.xml #
Crossfire has a single dependency that needs to be added to your Element.
<dependency>
<groupId>dev.getelements.elements.crossfire</groupId>
<artifactId>element</artifactId>
<version>${crossfire.version}</version>
</dependency>
2. Update <properties> in pom.xml #
<properties>
<! -- Existing Properties -->
<crossfire.version>1.0.4</crossfire.version>
</properties>
π Note
Do not replace the entire properties section. only add <crossfire.version>1.0.4</crossfire.version> to the existing properties
<crossfire.version>1.0.2</crossfire.version>
3. Make the SDK Aware of Namazu Crossfire #
In order to make the SDK aware of the Crossfire Element, you must update the loader to include it in the application.
// Create the local instance of the Elements server
final var local = ElementsLocalBuilder.getDefault()
.withElementNamed(
"example",
"com.mystudio.mygame",
PropertiesAttributes.wrap(elementProperties))
+ .withElementNamed(
+ "example",
+ "dev.getelements.elements.crossfire",
+ PropertiesAttributes.wrap(crossfireProperties))
.build();
π Note
Be sure to replace the name “example” with the application you are using in your particular case.
Verify Successful Deployment #
After enabling in your local IDE, perform the following steps to ensure that Namazu Crossfire was successfully added to the project.
- Launch the Namazu Elements in your IDE.
- Visit your local instance’s browser at http://localhost:8080/admin/
- Login using the default credentials or credentials you know to work for a SUPERUSER
- Default Username: root
- Default Password: example

- Check the left-hand side of the Namazu Elements Admin Panel
- Near the bottom you should see your game’s Element along side Namazu Crossfire

- Ensure that “CLEAN” appears under the application, in this case the application is named “example”
- Click on “crossfire” to see the deployment status.

π Note
If you use advanced configuration parameters, such as overriding Namazu Crossfire’s default URL these settings may appear slightly differently. The most important things to observe are the deployment status (CLEAN) and the URI from where Namazu Crossfire is hosted.

