#######################################################################

Tool:   COGS Gamearena IRC proxy
Author: Luigi Auriemma
e-mail: aluigi@autistici.org
web:    aluigi.org

#######################################################################


1) Introduction
2) Requirements
3) How to use
4) cogs_irc.ini
5) To know


#######################################################################

===============
1) Introduction
===============

COGS Gamearena is a partially web based program used to find the
dedicated servers hosted by the same people on Gamearena.

  http://gamearena.com.au

The program I have written is an IRC proxy server (a tunnel) needed to
chat with the preferred IRC client because the IRC server of COGS
checks the IP addresses of the people that have logged in so if you are
unable to log into the server (port 11120) you cannot enter in the IRC
server (port 4445 closed).
Then there are also other 2 features that avoid valid players to chat
easily and are the CRYP command sent by the server (a challenge
response algorithm available on my website
http://aluigi.org/papers/cogs_irc_chall.h) and the need to
login each 3 minutes or the IRC server blocks the connection (this
limitation seems to have been removed recently).

I think (or I hope) this tool is enough useful moreover for the Linux
users that are unable to find their Gamearena's friends when they don't
have a Windows system (for example at work).
The tool is opensource so it can be compiled on a lot of operating
systems and can be modified, improved and so on.

Then I like freedom and this tool gives to the users all the freedom of
connecting to the COGS IRC server with their preferred IRC clients
without limitations.

Naturally send me comments and feedback if you find problems or if you
have news or ideas.


#######################################################################

===============
2) Requirements
===============

You need:

- a valid Gamearena account:
  http://www.gamearena.com.au/account/join.php

- OpenSSL library:
  http://www.slproweb.com/products/Win32OpenSSL.html

- your preferred IRC client:
  http://dmoz.org/Computers/Software/Internet/Clients/Chat/IRC/

  if a channel requires a key, try with "cogs", example:
  /join #quake4demo cogs

The program has been created for being used from the command-line but
works also with the usual "double-click" on the executable file with
the only small problem that the "black window" will closes if an error
happens or if your account is not valid.
More info here:

  http://aluigi.org/about.htm#howuse


#######################################################################

=============
3) How to use
=============

Using my tool is extremely simple.
Launch it and insert the username and password.

There are also other some options that you can specify at command-line
and are:

-u U P    specify username (U) and password (P)
-k        enable keep-alive login (no longer required)
-p PORT   local port bound by this proxy server (default 6667)
-b IP     local interface to bind, use 0 for any (default 127.0.0.1)
-v        verbose, shows every (decrypted) data sent and received
-s H[:P]  change the default login server (144.140.155.6:11120)
          For example Xtra (http://games.xtra.co.nz) uses 210.55.92.2:11120
-S H[:P]  change the default IRC server (thearena-chat.gamearena.com.au:4445)
          For example Xtra (http://games.xtra.co.nz) uses 210.55.92.2:11140

When you launch the tool you will see some informations one the screen
and when the tool is ready you will see the "IRC proxy enabled" message
and you can connect your IRC client to 127.0.0.1 6667 (or any other
port choosed with the -p option).


#######################################################################

===============
4) cogs_irc.ini
===============

In the program's folder there is also a file called cogs_irc.ini, it is
used just for saving your default configuration so you don't need to
re-enter the parameters all the time.

Configuring it is very simple, just add your parameters after the = of
the option.
For example:

username=myuser
password=mypass
login_server=144.140.155.6:11120
irc_server=thearena-chat.gamearena.com.au:4445
proxy_port=12345
keep-alive=0


#######################################################################

==========
5) To know
==========

The Gamearena login server listens on port 11120 while the IRC server
on port 4445.

The client's commands NICK and USER are blocked by my tool because the
server kicks you if you don't use the valid nickname used to log in.

To compile my tool on Linux you must specify -lssl -lpthread.

The tool is composed by a proxy that creates a connection between the
client and the COGS server looking for the CRYP, the NICK and the USER
commands.

To log into the login server the protocol requires an uniqueID that my
tool randomly generates at runtime although seems the real COGS client
uses ever the same.

Although my tool supports multiple connection you cannot connect more
IRC clients at the same time with the same nickname (actually the
multiple nicknames are not yet supported by the tool).


#######################################################################

