Author Topic: [TUTORIAL] How to set up gcb  (Read 11637 times)


  • Administrator
  • Hero Member
  • *****
  • Posts: 566
  • Karma: +86/-12
    • View Profile
[TUTORIAL] How to set up gcb
« on: December 14, 2013, 06:58:32 pm »

    Before using gcb, we have to install a Java Runtime Environment (JRE) version >= 5.0 and, if you use Oracle's JRE, also the Java Cryptography Extension Unlimited Strength Jurisdiction Policy Files (JCE-policy).

    For the JRE, there are two options that are known to work with gcb: Oracle JRE and OpenJDK. OpenJDK is hard to set up on Windows, so if you're using Windows then go with Oracle's. Oracle's JRE can be downloaded here; select the first JRE download link from the table (at the time of this post, Java SE 7u5). OpenJDK instructions are available here for binaries and here for source (if you download source, you'll have to compile everything yourself).

    If you chose to use Oracle's JRE, you also need to install the JCE-policy files, either version 6 or version 7 (if you just installed JRE, you have JRE version 7, so use the second link).

    All other dependencies are included with gcb. However, you might be able to find newer versions. The libraries needed are:

    Again, you don't need to get these because gcb includes them.


    Ok, now we have to download gcb. Since gcb is still in development, the recommended way is to download directly from the git repository. To do this, go to GitHub project page and look for "HTTPS clone URL" on the right sidebar. You can either do a one-time download of the repository, by selecting "Download ZIP", or do a git clone so that you can update when new gcb modifications are released.

    git clone: For Windows, TortoiseGit is recommended, but you may also want to try GitHub for Windows. On other systems, we recommend the command-line git client (on Ubuntu/Debian, use apt-get install git, or on CentOS/RHEL, use yum install git-core). If you already cloned the git repository and want to update to the latest revision, use "git pull".

    Alternatively, you can visit our releases page and download the latest version.


    For the rest of the guide, suppose you've dowloaded gcb to a folder called gcb_dir.

    All configuration will be done in gcb_dir/bin/gcb.cfg, the gcb configuration file. Most of the options can be set to the default value, but some need to be configured. These are listed below:

    • gcb_tcp_host: the hostname-port pairs that GHost instances are hosting on; for example, if you have a two bots running on the same server as gcb on 6112 and 6113, and another bot at on 6114, use "localhost:6112, localhost:6113,"
    • garena1_username: Garena username
    • garena1_password: Garena password
    • garena1_roomname: uncomment this, and enter the room name that you want to connect to

    Make sure to comment garena1_roomid and garena1_roomhost (put a # before the options) if you enter garena1_roomname. So the GARENA SETTINGS section of gcb.cfg should look like:

    Code: [Select]
    # your Garena username
    garena1_username = garena

    # your Garena password
    garena1_password = garena

    # the main host (login server) to use
    garena1_mainhost =

    # the room gcb should join (if gcb_roomid and gcb_roomhost are not set)
    #  note that not set means the option must be commented out
    #  you should use gcb_roomid and gcb_roomhost if at all possible
    #  also, using gcb_roomname may not work if there is more than room with that name
    garena1_roomname = Garena Room Name

    # the room ID gcb should join
    #  See README for details on how to find this.
    # garena1_roomid =

    # the room host for gcb_roomid
    #  See README for details on how to find this.
    # garena1_roomhost =

    # the room password; leave uncommented or blank to not set one
    # garena1_roompassword =

    # the GP2PP port
    # each Garena connection should use a different port
    # in some cases you might have to forward this port (UDP) on router
    garena1_peerport = 1513

    Running gcb

    To run gcb, open up a terminal and change directory to where gcb is installed. Then, type
    Code: [Select]
    java -jar gcb.jar
    Alternatively, you can simply double-click gcb.jar.

    Memory optimization: if you're running in an environment with memory constraints (for example, old server or virtual machine), then you probably want to limit the heap size of gcb. Simply add the "-Xmx100m" flag if you want to limit it to 100 MB of memory:
    Code: [Select]
    java -Xmx100m -jar gcb.jar
    It is recommended that you remove everything in the plugins directory so that you don't get errors on startup, assuming you're not using the plugins.

    It is also recommended to apply the gcbi-extend patch to your GHost host bot (look for gcbi-extend-v2.patch in the gcb directory). Among other things, this will ensure that the host bot uses correct IP addresses. See GCBI below for details.


    Update: this is a warning that both gcb_bot and garena-room-control are no longer under development. There is currently no gcb-based Garena chat bot with active support.

    gcb_bot is a bot that can help you control your room. It's usage is not recommended, and it has been replaced by Garena Room Control (grc).

    Most of the bot functions are intended for channel admin usage.


    gcb's REVERSE options allow you to play on Garena without using the Garena client. You need to set gcb_reverse to true, and then it should work: just open up Warcraft III and you should see games.

    Connecting to multiple rooms

    As of gcb v0g, connecting to multiple Garena rooms is supported without running multiple instances of gcb. It is very easy to setup. Just add a section like this for each connection you wish to make:
    Code: [Select]
    garenaX_username = username
    garenaX_password = password
    garenaX_mainhost =
    garenaX_roomname = Garena Room Name
    garenaX_peerport = 0

    Replace X with a connection number (between 1 and 30). You will have to use a different peer port for each realm connection that you make; if you set it to 0 (like above), then gcb will automatically select a port.

    Note that if you use gcb REVERSE this might do something weird; it's only intended for usage when hosting with gcb.


    GCBI is a protocol between gcb and a GHost host bot that gives GHost information about a joining Garena player. The most important information transferred is the user's IP address. This ensures that multiple IP address warnings don't incorrectly show, and that an IP ban won't prevent any gcb users from joining.

    (Sidenote: the old GCBI non-extend patch is deprecated, and has been fully replaced by gcbi-extend patch.)

    First, you have to apply the GCBI extend patch to your host bot; look for the gcbi-extend-v2.patch file in the gcb directory. See for information on how to do this.

    Then, you need to recompile the host bot. See

    Finally, use the newly compiled binary to run your host bot, and edit gcb.cfg to set gcb_enablegcbi = true.
    « Last Edit: December 14, 2013, 07:00:43 pm by uakf.b »