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

GS peerchat server emulator
by Luigi Auriemma
e-mail: aluigi@autistici.org
web:    aluigi.org

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


1) Introduction
2) How to use: server
3) How to use: clients
4) Practical example
5) peerchat.gamespy.com IP address


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

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


This program is nothing more than a proxy which allows the games or
applications that use the Gamespy peerchat.gamespy.com encrypted IRC
server to join in any normal IRC server.

The following is the scheme of how the thing works:

|--| .---.                |--| .---.                |--| .---.
|--| | A |    encrypted   |==| | B |    plain-text  |==| | C |
|-.| '---'  <===========> | o| '---'  <===========> | o| '---'
|__|/====*\               |__|/====*\               |__|/====*\
^                         ^                         ^
Race Driver             peerchat_server             IRC server

A is a game that uses the peerchat server like RaceDriver, Panzers
  Phase One/Two, Sacrifice, Chris Moneymaker's World Championship Poker
  and many others. Also Gamespy Arcade!
  The only thing required by A is having the peerchat.gamespy.com
  resolved as the IP address of B like explained in section 5 of this
  readme.

B is the computer which runs peerchat_server (this tool)

C is a normal IRC server, A joins B and B redirects the data of A to C.
  B and C can be the same computer!

D, E, F, ... Z are other clients which run different games and connect
  to C.

Result: your game client has joined a normal IRC server instead of
peerchat.gamespy.com so for example you can create an IRC server for
your clan and many other things limited only by your fantasy.

This program supports both the encrypted data and the old plain-text
protocol used for example by the game Sacrifice.


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

=====================
2) How to use: server
=====================


Peerchat_server accepts 2 parameters:
- port: the port of the normal IRC server to which you want to
        connect, like 6667 for example
- host: (optional) the IRC server in which you want to join. By default
        this parameter is set to 127.0.0.1 which means the proxy
        connect to the local IRC server running on your same machine

When peerchat_server is running check that the normal IRC server is
running too. If this server is on your same machine you MUST set it on
a port different than 6667 because this port is already used by
peerchat_server.

Example of proxy and server running on the same machine, with the IRC
server running on port 6668:

  peerchat_server 6668

Example of usage of an external IRC server (example irc.azzurra.org):

  peerchat_server 6667 irc.azzurra.org


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

======================
3) How to use: clients
======================


The clients need to modify their hosts file for being able to join the
peerchat server emulator.
In fact games automatically join peerchat.gamespy.com:6667 so you must
force your computer to assign the hostname peerchat.gamespy.com to the
IP where is running peerchat_server.

Read section 5.

When you will launch your game it will automatically connect to the
computer which runs peerchat_server.


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

====================
4) Practical example
====================


If you don't have or have never configured an IRC server do the
following:
Download the following IRC server created by Salvatore Sanfilippo:

  http://www.hping.org/tclircd/

If you are on Windows you need also Tcl:

  http://www.activestate.com/Products/ActiveTcl/

Now open the file ircd.tcl with a text editor and go to its end where
is located the text string "config tcpport 6667".
Substituite 6667 with 6668.

Now launch the IRC server (double click on ircd.tcl).

Unzip peerchat_server.zip in a folder like c:\peerchat

Download the following file and copy it in the folder where you have
placed the peerchat_server files:

  http://aluigi.org/papers/gslist.cfg

Launch the console, enter in the peerchat folder and type:

  peerchat_server 6668

The server configuration is now finished, the rest is for the clients or
for testing if everything works.


Now you must add the peerchat.gamespy.com redirect in your hosts file.
It is very simple and if you don't know how to do it, read the next
section.
Remember to delete or to add a # at the beginning of the added line when
you want to restore the normal handling of the peerchat.gamespy.com IP
address.

Ok everything is setted so all you need now is to launch a game that
uses the server peerchat.gamespy.com.
If you don't have games that use this server (but in this case why you
have downloaded this tool???) you can try with the multiplayer demo of
Race Driver:

  http://www.3dgamers.com/dlselect/games/tocaracedriver/racedriver_multiplayer_demo.zip.html

Contact me if something is not clear or you have problems.


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

==================================
5) peerchat.gamespy.com IP address
==================================


The hosts file is the system file containing static IP addresses for
specific hostnames, it is usually located in one of the following
directories of Windows:

 Windows 95/98/Me       c:\windows\hosts
 Windows NT/2000/XP Pro c:\winnt\system32\drivers\etc\hosts
 Windows XP Home        c:\windows\system32\drivers\etc\hosts

or in /etc/hosts on Linux and other Unix systems.
If the file doesn't exist, CREATE it.

Now add the following line at the end of the file:

  PEERCHAT_IP    peerchat.gamespy.com

where PEERCHAT_IP is the IP address of the computer on which is running
the tool peerchat_server.

For example if the proxy is running on the server 1.2.3.4 all the
clients that want to use it in their game must add:

  1.2.3.4    peerchat.gamespy.com

If you are a client and peerchat_server is running on your same machine
use:

  127.0.0.1    peerchat.gamespy.com


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