Skip to content

Update USING.md #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions docs/USING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,47 @@ At the moment, we would not recommend using Mars for servers that rely on perfec

### Using

Download the latest Mars build [here](https://nightly.link/Warzone/mars/workflows/build/master/Mars.zip).
1. Download the latest Mars build. You can find this by going to the [actions tab](https://github.com/Warzone/mars/actions) and navigating to the latest successful build.

On a PGM server ([setup guide](https://github.com/PGMDev/PGM/blob/dev/docs/RUNNING.md)), add the Mars plugin JAR file to the server's `plugins/` folder. After starting the server once, Mars will generate [a config file](https://github.com/Warzone/mars/blob/master/src/main/resources/config.yml) which you need to modify to match the API (API URLs and secret token). Once the config is updated, restart the server and Mars should be working (you should see a connection message in the API console).
2. Download the latest [Mars API](https://github.com/Warzone/mars-api) build. You can find this by going to the [actions tab](https://github.com/Warzone/mars-api/actions) and navigating to the latest successful build.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that new features in Mars are exclusively backed by the Rust implementation of the API, we need to reflect that here -- maybe mention both implementations as options but recommend the Rust one for availability of new features, and mention the last version of Mars that works with the Kotlin API?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

archiving the old api and only encouraging the use of the rust API feels like the best approach. there might be changes made in the future that might break support in the future and in case that happens, discouraging its use is probably the best idea. maybe not even mention the old one and only link to the rust api.


3. Ensure you have a cloud database set up. For those unfamiliar with database creation, we recommend using MongoDB [(installation guide)](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-windows/).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mongo is actually the only mainstream option for Mars, so recommend is a bit misleading - Mars uses Mongo but Mongo-compatible DBs should work (untested)


4. Ensure [Redis](https://redis.io/download/#redis-downloads) is installed and running. For Windows users, you can follow [this tutorial](https://redis.io/docs/getting-started/installation/install-redis-on-windows/) for setting up Redis using WSL2.

5. In a terminal, open the directory with the standalone Mars API jar, and run it. If you're using a MongoDB localhost with the default port, you won't need to change anything; otherwise, you will need to modify the API URLs accordingly. By default, Mars API runs on port 3000.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this step also needs to be updated to reflect the new Rust API implementation

```bash
cd /path/to/folder
java -jar Mars-API.jar
```
6. On a PGM server ([setup guide](https://github.com/PGMDev/PGM/blob/dev/docs/RUNNING.md)), add the Mars plugin JAR file to the server's `plugins/` folder. After starting the server once, Mars will throw an error and generate [a config file](https://github.com/Warzone/mars/blob/master/src/main/resources/config.yml), which you need to modify to match the API (API URLs and secret token). Once the config is updated, restart the server and Mars should be working (you should see a connection message in the API console).

(Note: If you are having connection timeout issues, try turning off your anti-virus firewall).

You can learn more about Mars' architecture [here](https://github.com/Warzone/mars/tree/master/docs/CONTRIBUTING.md).

### Sample Config File

```bash
server:
id: 'main'
links:
appeal: 'https://warz.one/discord'
store: 'https://warz.one/store'
discord: 'https://warz.one/discord'
rules: 'https://warz.one/rules'

api:
secret: 'auth' # modified api token
socket:
url: 'wss://localhost:3000' # modified api url
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wss is for secure websockets (similar to HTTPS) so I'm not sure if that works with localhost out of the box, if it doesn't, it'd be better for this to use ws

http:
url: 'http://127.0.0.1:3000' # modified api url

chat:
enabled: true
```

### Caveats

- For gamemode stats to work during a match (i.e. Flags Captured, Cores Leaked), the map definition (`map.xml`) must include a `<gamemode>` tag with the map's gamemodes. This may be changed in the future, but it is advisable to use `<gamemode>` tags for data accuracy regardless.