Skip to main content

Arbitrium Troubleshooting

Problem when registering the game server with an external service.#

When your server is booted, you want to register it on a third-party service; the external service can't reach your server. It is usually a port register problem (Just like figure A).

img

The application ports can't be reached directly from any external source. The ports are automatically mapped to the external, and you should register the server with the NATed ports. It's possible to retrieve the ports from your deployment. You will need to use ARBITRIUM_CONTEXT_URL and ARBITRIUM_CONTEXT_TOKEN to get the information form your container itself. Here's a python script that retrieves the data.

import json
import os
import requests
def main():
# Getting the url and its security token
arbitrium_url = os.getenv('ARBITRIUM_CONTEXT_URL')
arbitrium_token = os.getenv('ARBITRIUM_CONTEXT_TOKEN')
if arbitrium_url and arbitrium_token:
# Making the HTTP request. Dont't forget the authorization header
reply = requests.get(arbitrium_url, headers={'authorization': arbitrium_token})
# Getting the data and do whatever you want with it
if reply.status_code == 200:
data = reply.json()
ports = data.get('ports')
port_7777 = ports['7777']
external_port_7777 = port_7777['external']
port_27015 = ports['27015']
external_port_27015 = port_27015['external']
print(external_port_7777)
print(external_port_27015)
# Just python thing
if __name__ == '__main__':
main()

You should not change the ports that your game server is listening to. Just like figure B

img