|
| 1 | +#!/bin/bash |
| 2 | +# |
| 3 | +# This is a sample script for running a TripleA bot on a Unix-like system. |
| 4 | +# |
| 5 | +# THIS SCRIPT MAY NOT RUN CORRECTLY UNLESS YOU CUSTOMIZE SOME OF THE VARIABLES |
| 6 | +# BELOW! Please read each variable description carefully and modify them, if |
| 7 | +# appropriate. |
| 8 | +# |
| 9 | +# To run this script, change to the directory in which you unpacked the |
| 10 | +# headless game server archive, and type "./run_bot". |
| 11 | +# |
| 12 | + |
| 13 | +############################################################################### |
| 14 | +# VARIABLES THAT YOU MAY CUSTOMIZE BEGIN HERE |
| 15 | +############################################################################### |
| 16 | + |
| 17 | +# |
| 18 | +# The folder from which the bot will load game maps. |
| 19 | +# |
| 20 | +# The default value is the folder in which the TripleA game client stores |
| 21 | +# maps that it downloads. Under normal circumstances, you will not have to |
| 22 | +# change this variable. However, if you customized the settings in your |
| 23 | +# TripleA client to use a different maps folder, you should change this |
| 24 | +# variable to refer to the same location. |
| 25 | +# |
| 26 | +readonly MAPS_FOLDER="$HOME/triplea/downloadedMaps" |
| 27 | + |
| 28 | +# |
| 29 | +# The port on which the bot will listen for connections. This port must be |
| 30 | +# reachable from the Internet, so you may have to configure your firewall |
| 31 | +# appropriately. |
| 32 | +# |
| 33 | +# Under normal circumstances, you will not have to change this variable. |
| 34 | +# However, if you choose to run multiple bots on your system, you need to |
| 35 | +# select a different available port for each bot. |
| 36 | +# |
| 37 | +readonly BOT_PORT=3300 |
| 38 | + |
| 39 | +# |
| 40 | +# The name of the bot as displayed in the lobby. Each bot must have a unique |
| 41 | +# name. |
| 42 | +# |
| 43 | +# The default value uses a combination of your username and the local port |
| 44 | +# you selected above on which the bot will run. Under normal circumstances, |
| 45 | +# you will not have to change this variable. |
| 46 | +# |
| 47 | +readonly BOT_NAME="Bot_${USER}_${BOT_PORT}" |
| 48 | + |
| 49 | +# |
| 50 | +# The password used to secure access to games running on your bot. Users |
| 51 | +# attempting to start a new game or connect to an existing game on your bot |
| 52 | +# will be prompted for this password. If the password is an empty string, |
| 53 | +# the user will not be prompted, and any lobby user will be able to use your |
| 54 | +# bot. |
| 55 | +# |
| 56 | +# The default value is an empty password. You should change this to a |
| 57 | +# non-empty string if you do not want arbitrary users to use your bot. For |
| 58 | +# example, you may wish to run a private game for you and some friends. In |
| 59 | +# that case, set the password to a non-empty string and communicate it to |
| 60 | +# your friends in some manner (e.g. via email). |
| 61 | +# |
| 62 | +readonly BOT_PASSWORD= |
| 63 | + |
| 64 | +# |
| 65 | +# The hostname of the lobby to which the bot will connect. |
| 66 | +# |
| 67 | +# The default value is the hostname for the TripleA community's public lobby. |
| 68 | +# Under normal circumstances, you will not have to change this variable. |
| 69 | +# |
| 70 | +readonly LOBBY_HOST=lobby.triplea-game.org |
| 71 | + |
| 72 | +# |
| 73 | +# The port on which the lobby to which the bot will connect listens for |
| 74 | +# connections. |
| 75 | +# |
| 76 | +# The default value is the port for the TripleA community's public lobby. |
| 77 | +# Under normal circumstances, you will not have to change this variable. |
| 78 | +# |
| 79 | +readonly LOBBY_PORT=3304 |
| 80 | + |
| 81 | +# |
| 82 | +# The email address at which you can be contacted. Lobby moderators will |
| 83 | +# communicate with you using this email address if they notice problems with |
| 84 | +# your bot, or if they need to perform remote maintenance on your bot (e.g. |
| 85 | +# to shut down your bot). |
| 86 | +# |
| 87 | +# The default value is meaningless. IT IS STRONGLY RECOMMENDED THAT YOU |
| 88 | +# CHANGE THIS VARIABLE TO A VALID EMAIL ADDRESS THAT YOU CONTROL. |
| 89 | +# |
| 90 | +readonly LOBBY_SUPPORT_EMAIL="${USER}@localhost.localdomain" |
| 91 | + |
| 92 | +# |
| 93 | +# The password used to secure remote maintenance of your bot. A lobby |
| 94 | +# moderator who wishes to perform remote maintenance on your bot will be |
| 95 | +# required to enter this password in order to complete any maintenance |
| 96 | +# action. If the password is an empty string, a lobby moderator will be able |
| 97 | +# to perform remote maintenance on your bot without your permission. |
| 98 | +# |
| 99 | +# The default value is an empty password. You should change this to a |
| 100 | +# non-empty string if you do not want lobby moderators to interfere with the |
| 101 | +# operation of your bot. Note that a lobby moderator that cannot perform |
| 102 | +# remote maintenance of your bot may choose to boot your bot from the lobby. |
| 103 | +# |
| 104 | +readonly LOBBY_SUPPORT_PASSWORD= |
| 105 | + |
| 106 | +############################################################################### |
| 107 | +# VARIABLES THAT YOU MAY CUSTOMIZE END HERE |
| 108 | +# |
| 109 | +# DO NOT MODIFY ANYTHING BELOW THIS LINE! |
| 110 | +############################################################################### |
| 111 | + |
| 112 | +java \ |
| 113 | + -server \ |
| 114 | + -Xmx256M \ |
| 115 | + -Djava.awt.headless=true \ |
| 116 | + -jar bin/triplea-game-headless-*-all.jar \ |
| 117 | + -Ptriplea.game= \ |
| 118 | + -Ptriplea.lobby.game.comments=automated_host \ |
| 119 | + -Ptriplea.lobby.game.hostedBy="$BOT_NAME" \ |
| 120 | + -Ptriplea.lobby.game.supportEmail="$LOBBY_SUPPORT_EMAIL" \ |
| 121 | + -Ptriplea.lobby.game.supportPassword="$LOBBY_SUPPORT_PASSWORD" \ |
| 122 | + -Ptriplea.lobby.host="$LOBBY_HOST" \ |
| 123 | + -Ptriplea.lobby.port="$LOBBY_PORT" \ |
| 124 | + -Ptriplea.map.folder="$MAPS_FOLDER" \ |
| 125 | + -Ptriplea.name="$BOT_NAME" \ |
| 126 | + -Ptriplea.port="$BOT_PORT" \ |
| 127 | + -Ptriplea.server=true \ |
| 128 | + -Ptriplea.server.password="$BOT_PASSWORD" |
0 commit comments