Changes between Version 13 and Version 14 of SettingUp


Ignore:
Timestamp:
May 4, 2008 4:15:34 PM (11 years ago)
Author:
Maverick
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SettingUp

    v13 v14  
    1 {{{ 
    2 #!comment 
    3  
    4 PAGE RENAMED TO SETTINGUPWINDOWS 
    5 /wiki/SettingUpWindows 
    6  
    7 [[TracNav(Index)]] 
    8 [[TOC]] 
    9  
    10 = Setting up TWCore for Windows = 
    11 Prior warning: I must admit that the bots that come with TWCore aren't the best to be applied to any zone, most of them are quite specific for Trench Wars. However, the TWCore Core is a good basis for hosting and creating new bots on. 
    12  
    13 How do we go about setting up TWCore to work in your zone? It comes down to doing the following steps: 
    14   1. [#Prerequisites Prerequisites] 
    15   1. [#DownloadingTwcore Downloading TWCore] 
    16   1. [#BuildingTWCore Building TWCore] 
    17   1. [#Configuration Configuration] 
    18   1. [#Readytorun Ready to run] 
    19  
    20 '''Directory structure'''[[BR]] 
    21 The following directory structure is recommended and used throughout this guide: 
    22  
    23 || `C:Subspace` || || 
    24 || `C:Subspacein` || || 
    25 || `C:Subspaceinant` || Ant installation || 
    26 || `C:Subspaceinsvnkit` || SVNKit installation || 
    27 || `C:Subspace  wcore` || TWCore main directory || 
    28 || `C:Subspace  wcorein` || TWCore binary and configuration files || 
    29 || `C:Subspace  wcoresrc` || TWCore source export from repository || 
    30  
    31  
    32 Problems while following this guide? Ask your question at the [/discussion forum]! 
    33  
    34  
    35 === Prerequisites === 
    36  
    37 There are some things you need to have for running TWCore: 
    38  1. [http://java.sun.com/javase/downloads/index.jsp Java Development Kit (JDK)][[BR]] 
    39     Install to a directory of your choice. 
    40  
    41  2. [http://ant.apache.org/bindownload.cgi Ant] (Download ''Current Release of Ant'', .zip archive)[[BR]] 
    42     Extract to a directory of your choice. However, it's recommended to extract to a subdirectory close your twcore directory. For example, `C:subspaceinant` . Make sure you don't extract a new directory `apache-ant-1.7.0` inside the `binant` directory but directly into the `binant` directory. 
    43    
    44  3. [http://svnkit.com/download/index.php SVNKit] (Download the ''Latest Stable Version'', ''Standalone Version'')[[BR]] 
    45     Extract to a directory of your choice. However, it's recommended to extract to a subdirectory close your twcore directory. For example, `C:subspaceinsvnkit` . Make sure you don't extract a new directory `svnkit-1.1.4` inside the `binsvnkit` directory but directly into the `binsvnkit` directory. 
    46    
    47  4. (Access to) a [http://www.shanky.com/server Subspace zone] 
    48  
    49 Optional: 
    50   1. (Access to) a [http://www.mysql.org/ MySQL] database 
    51  
    52  
    53 __Java check__ [[BR]] 
    54 Once you have java installed, make sure you can run `java` from the command prompt. To test/setup, follow these steps: 
    55  1. Click Start 
    56  1. Click Run... 
    57  1. Type 'cmd' in the text field and press Enter or click OK. 
    58  1. Type 'java -version' [ENTER] 
    59  1. If you see [[BR]] 
    60  `'java' is not recognized as an internal or external command, operable program or batch file.` [[BR]] 
    61   then you need to set the PATH to the location of your installed Java version.[[BR]] 
    62    a. Find where you've installed Java and copy the complete path of the bin directory 
    63    a. Go to your System Properties (via Control Panel) 
    64    a. Go to the Advanced tab 
    65    a. Click on the 'Environment Variables' button 
    66    a. Find the 'Path' variable in the 'System variables' section 
    67    a. Click on 'Edit' 
    68    a. In the 'Variable value' text field append an ';' and paste the path of your Javain location. For example; `C:Program FilesJavajdk1.6.0_03in` 
    69    a. Click the OK button 3 times and try the above again. 
    70  1. Type `ECHO %JAVA_HOME%` 
    71  1. If you see [[BR]] 
    72    `%JAVA_HOME%` 
    73    then you need to setup this variable aswell: 
    74    a. Find where you've installed Java and copy the complete path of the directory 
    75    a. Go to your System Properties (via Control Panel) 
    76    a. Go to the Advanced tab 
    77    a. Click on the 'Environment Variables' button 
    78    a. Click the Create button in the 'System variables' section 
    79       Name: JAVA_HOME 
    80       Value: Complete path to the Java installation directory. For example; `C:Program FilesJavajdk1.6.0_03` 
    81    a. Click the OK button 3 times and try the above again. 
    82  
    83 === Downloading TWCore === 
    84 In this step you will export the most recent TWCore version from the repository of twcore.org . 
    85  
    86  1. [attachment:update.bat?format=raw Download update.bat] and save it in the directory `C:subspace` with the name `update.bat`.  
    87  1. Execute this batch file by double clicking it 
    88  1. If all goes well you should see the following output when the execution has finished: 
    89     [[Image(update.gif)]] 
    90  
    91 You can always update TWCore safely as it doesn't effect any running / binary files nor your configuration files. 
    92  
    93  
    94 === Building TWCore === 
    95 Before you can use and configure TWCore, it needs to be built. 
    96  
    97  1. [attachment:build.bat?format=raw Download build.bat] and save it in the directory `C:subspace` with the name `build.bat`. 
    98  1. Execute this batch file by double clicking it 
    99  1. If all goes well you should see the following output when the execution has finished: 
    100     [[Image(build.gif)]] 
    101  
    102 Note for building TWCore, TWCore must be turned off completely! Your configuration files will not be touched during the build process. 
    103  
    104 === Configuration === 
    105  Go into the `C:subspace        wcorein` folder with explorer and configure the configuration files: 
    106  
    107  1. Rename setup.example.cfg to setup.cfg 
    108  1. Open setup.cfg and fill in the settings: 
    109   * `[Server]` 
    110    * `Server`[[BR]] 
    111    should be set to the IP of the Subspace server you are connecting to 
    112    * `Port`[[BR]] 
    113    should be set to the port of the Subspace server you are connecting to 
    114   * `[Login Information]` 
    115    * `Main Login`[[BR]] 
    116    the name of the Continuum account for the TWCore Hubbot. This name '''must''' be registered already. 
    117    * `Main Password`[[BR]] 
    118    the password of the Continuum account for the TWCore Hubbot. 
    119    * `Sysop Password`[[BR]] 
    120    the sysop password for the zone you are connecting to. 
    121   * `[Chat Names]` 
    122    * `Chat Name`[[BR]] 
    123    the default chat name of any bots that require it. Usually this is used to set to a chat used by the TWCore developers. 
    124    * `Staff Chat`[[BR]] 
    125    the chat name of the staff chat. 
    126    * `Smod Chat`[[BR]] 
    127    the chat of the smod/upper staff chat. 
    128   * `[Debugging]` 
    129    * `DebugOutput`[[BR]] 
    130    Set DebugOutput to 0 to turn stack traces off, 1 to turn them on. Stack traces are useful for debugging bots. 
    131   * `[Directories]` 
    132    * `Core Location`[[BR]] 
    133    Set this to the exact location where this setup.cfg is located. Do not end this with a slash. For example: `C:SubspaceTWCore` (Windows) or `/home/bots/twcore` (Linux). 
    134   * `[Logging]` 
    135    * `Exception Log`[[BR]] 
    136    Set the file and path of the exception log. This log will contain any exceptions the bot runs into. For example: `C:SubspaceTWCoreexception.log` or `/home/bots/twcore/exception.log` 
    137    * `LogPrivateMessages`[[BR]] 
    138    Set LogPrivateMessages to 1 to have each bot record private messages in the /logs folder. 
    139  
    140  3. Rename all the files in the corecfg directory to .cfg. For example: autoload.cfg and sql.cfg. Small description of each configuration file: 
    141   * autoload.cfg[[BR]] 
    142   All the bots in this file will be automatically spawned when TWCore is started and connected to the Subspace server. 
    143   * develop.cfg[[BR]] 
    144   Any names in this file will have developer powers on the bot (higher then ER, lower then Mod). 
    145   * highmod.cfg[[BR]] 
    146   Any names in this file will have High Moderator powers on the bot (higher then mod but lower then super moderator). 
    147   * outsider.cfg[[BR]] 
    148   Any names in this file will have outsider powers on the bot (higher then ZH lower then ER). 
    149   * owners.cfg[[BR]] 
    150   Any names in this file will have owner access on the bot (highest access level). Make sure you have your own name set in this file or else you won't be able to control the bots. 
    151   * sql.cfg[[BR]] 
    152   This file contains the settings for working with a database. If you do not (want to) use a database, set `ConnectionCount` to 0. For more information, see below. 
    153  
    154  4. [Optional] Configure sql.cfg: 
    155   * `[General]` 
    156    * `RetryCount`[[BR]] 
    157    Amount of retries a connection is tried before it will be given up 
    158    * ConnectionCount[[BR]] 
    159    Number of connections defined in this file and/or number of connections that are used. 
    160   * `[Connection X]`  (Replace X for a number starting with 1, also with settings below) 
    161    * `NameX`[[BR]] 
    162    Name of the connection. This same name is also used by the bots. The connection names used by the bots that come with TWCore are `local`, `website` and `server`. 
    163    * `DriverX`[[BR]] 
    164    Name of the sql driver. This is usually set to `com.mysql.jdbc.Driver` which you don't need to change unless you want to work with a different type database then MySQL. 
    165    * `LoginX`[[BR]] 
    166    The username used for connecting to the database server. 
    167    * `PasswordX`[[BR]] 
    168    The password used for connecting to the database server. 
    169    * `DataBaseX`[[BR]] 
    170    The database name that should be used. Make sure this database already exist on the server. 
    171    * `ServerX` [[BR]] 
    172    The IP or the address of the database server. If the database is on the same machine, set it to `localhost`. If the database is not on this machine, make sure you have the database server configured that it allows external connections. 
    173    * `PortX` [[BR]] 
    174    The port used to communicating with the database server. If you are using a MySQL server then you can leave it set to `3306`. 
    175    * `MinPoolSizeX` [[BR]] 
    176    The minimum number of connections required to be in the pool. You can leave the default set to `1`. 
    177    * `MaxPoolSizeX`[[BR]] 
    178    The maximum number of connections of the connection pool. You can leave the default set to `10`. 
    179    * `WaitIfBusyX`[[BR]] 
    180    Wait if the connection is busy. Can be set to `0` or `1`.[[BR]][[BR]] 
    181    You can create several connections in this file, you only need to change the X in each setting to the respective connection number. 
    182  
    183 === Ready to run === 
    184 If you have configured everything then you should be all set! 
    185  
    186  1. [attachment:run.bat?format=raw Download run.bat] and save it in the `C:subspace` folder. 
    187  1. Double click `run.bat` to start TWCore 
    188  1. The bot with the name you configured in setup.cfg will now enter your zone. This is the HubBot, it can spawn other bots on your command. 
    189  
    190 == Spawning bots == 
    191 In TWCore we have two names for a specific bot; the bot type and the bot name. [[BR]] 
    192 The bot type is the name of the directory. The main .java and .cfg file within this directory both have the same name as the bot type. You use this bot type to specify which bot to spawn. The bot name is the name you configure inside the .cfg file. 
    193  
    194 To spawn a bot follow the following steps: 
    195  
    196  1. The first time you spawn a bot you have to rename its .example.cfg file to .cfg.[[BR]] 
    197  For example, multibot.example.cfg to multibot.cfg. 
    198  1. Open the .cfg file (with notepad for example) and set the correct values. This usually consists of configuring the name, password and initial arena. 
    199  1. Start up TWCore if you haven't already 
    200  1. PM `!spawn <bottype>` to your HubBot. 
    201  1. If the bot doesn't spawn into your zone, check the TWCore console for error messages. 
    202  
    203 Problems while following this guide? Ask your question at the [/discussion forum]! 
    204 }}} 
     1This page has been moved to [wiki:RunningOnWindows]. Please update the link pointing to this page.