BChat Server  for WINDOWS 95/98/2000/NT ( free edition) 

Software Essential Description: 
1. Real-time text and audio chat.(Payed editions support real-time text,audio and video chat).
2. Three basic language editions available accompany with the software:Chinese-simplified,Chinese-traditional,English. Other languages may be gotten through config file,you need only to translate the language config file into your favor language.
3. The upper limit of  visitors online is 10 per chatroom. The number of chatrooms is unlimited.
4. The chat room will show edition information and advertising information of CHAT.YINSHA.COM. The user can modify the layout of the chatroom freely. 
5. BChat Server runs as a executive file, it is different from any other general CGI scripts, need not any outside WEB SERVER support. 
6. Login check through database (ODBC).
   This software takes up little resources from the server. It is steady, secure, robust and fast. 

Platform:
  Microsoft WINDOWS
  
Install Instruction:
1. Unpack the .ZIP file under the driver D: , this will create a directory D:\BChat . Under D:\BChat, there are three sub directories:gb, big, english, they contain three kinds of language config files respectively: Chinese-simplified, Chinese-traditional, English.
   Choose and copy the sub-directory files of  your favourite language edition to the directory D: \BChat.
2. If you unpack the .ZIP file under other driver or directory, please remember to modify string correlated with relative path in the .ini chatroom config file.
3. Modify the values of item HOSTIP and IP adress in Host item in the .ini chatroom config file from 0.0.0.0 to your host IP address.
4. If running  several chatrooms at same host, please copy and create different .ini chatroom config file according to the above directions.
   Notice that the values of item PORT in these .ini files are not the same with each other.
5. If Unsatisfied with the default interface of chatroom , you can modify the html code of top.htm, body.htm and bottom.htm.
   Notice: Do not modify or delete string with tag '$'.
6. Each chatroom is set up flexibly , its interface and support of the database depend on the items of its .ini chatroom config file.
7. Language config file (chinesegb.txt,chinesebig5.txt and english.txt) determined some content that briefs on or showing in interfaces, and execute statement that access the table of database. You can modify content according to your need. 
   Note: the symbol such as |, %s, and the mark before every line can't be deleted or modified. Before doing it, you'd better make a backup first. 

The abbreviation in .ini chatroom config file is explained as follows: 

TITLE=[Name of chatroom]
PORT=[Port to run chatroom]
HOSTIP=[IP address of host]
DefaultName=BChatServer
EMOTEFile=[The emote file name, please use absolute path]
ADMINPASSFile=[The file that claims chatroom administrators' username and password , please use absolute path]
ChatLog=[Chatroom real-time text chat logfileplease use absolute path]
TOP_HTM=[The frame interface file of the chatroom, please use absolute path]
BODY_HTM=[The interface file of display area of the room, please use absolute path]
BOTTOM_HTM=[The interface file of input area of the room, please use absolute path]
Host=[IP address of host]|xxxxxxxxxxxxxxxxxxxx
DBSERVER=[The chatroom database ODBC source.If it is empty, no database needed, following DATABASE, DBUSERNAME, DBPASSWORD, ROOMTABLE items become void ]
DATABASE=[Database name of the room ]
DBUSERNAME=[Room database username]
DBPASSWORD=[Password for room database user]
ROOMTABLE=[Room database room table name]
ROOMTYPE=[Chatroom type]
MAXONLINE=[The maximum online number of the chatroom, no more than 10]
FILTERFile=[The obscene word filters file please use absolute path]
BOOTLOGFile=[Chatroom boot logfile please use absolute path]
NEEDAUTH=[Whether user needs to be verified before enter chatroom or not. 0 for needless , 1 for need, 2 for password passed  mark (add * before username) ]
AUTHSERVER=[Registered user database ODBC source , If it is empty,item NEEDAUTH and following AUTHDATABASE, AUTHUSERNAME, AUTHPASSWORD, AUTHTABLE items are void ]
AUTHDATABASE=[Name of the registered user database]
AUTHUSERNAME=[Username of registered user database]
AUTHPASSWORD=[Password correspond to the username]
AUTHTABLE=[Table name in the registered user Database]
LANGUAGE=[Language config file,please use absolute path]
MARKADMIN=[Whether to mark * after administrator's name, 1 is sure , 0 is default.]
KEY1=D:\BChat\key1 [KEY1please use absolute path]
KEY2=D:\BChat\key2 [KEY2please use absolute path]
IMAGEALLOW=[[Whether to allow insertion of images in chat or not. 0 is not allowed, 1 is allowed. ]
CLOSEALLOW=[To make the function of close-the-door validate or not. 0 for not and 1 for yes.]
MARKSEX=[Whether to mark username of different sex in different color , 0 is default.]

Database support (optional)

1. If no support of database needed, please leave values of item DBSERVER and AUTHSERVER in .ini chatroom config file leave blank(default).
2. If support of database needed, two tables for room and user respectively must be existed in database as follows.

The structure of table room is as follows:(table field name -- field type    statement)
port      bigint NOT NULL 			port of chatroom , indexed field
roomname  varchar(40) 			chatroom name , indexed field
pid       varchar(6) 			chatroom pid
num       int 				Online number of chatroom 
type       char(1)				the type of chatroom
host       varchar(20)			chatroom server IP address

The structure of table user is as follows:(table field name -- field type    statement)chatroom type
name      varchar(20) 			registered username , indexed field
passwd    varchar(20) 			password of registered username 
exps       bigint unsigned NOT NULL		total online time
lasttime  bigint unsigned NOT NULL 		last online time 

If your database table structure different from the above , please modify the execute statement that access the table in Language config file.

3. If needing support of database , please finish the config of ODBC in your host , then modify the following items in .ini config file.
   Chatroom database and tables config:
	DBSERVER=[The chatroom database ODBC source.If it is empty, the following DATABASE, DBUSERNAME, DBPASSWORD, ROOMTABLE items are void ]
	DATABASE=[Database name of the room ]
	DBUSERNAME=[Room database username]
	DBPASSWORD=[Password for room database user]
	ROOMTABLE=[Room database room table name]
	ROOMTYPE=[Chatroom type]
   Registered user database and tables config:
	NEEDAUTH=[If it needs to be verified to enter the chatroom. 0 for need, 1 need, 2 for password passed and add * before username ]
	AUTHSERVER=[Registered user database ODBC source , If it is empty, item NEEDAUTH and following AUTHDATABASE, AUTHUSERNAME, AUTHPASSWORD, AUTHTABLE items are void ]
	AUTHDATABASE=[Database name of the Registered user]
	AUTHUSERNAME=[Database username for registered user ]
	AUTHPASSWORD=[Password for Registered user's database username]
	AUTHTABLE=[Registered user's database table name]

Start and run the chatserver service
1. Start a chatroom service, type following command:
	D:\Bchat\bchat.exe  D:\Bchat\[chatroom.ini]
   For example,
   	D:\Bchat\bchat.exe  D:\Bchat\2000.ini
   Note that parameter D:\Bchat\2000.ini for bchat.exe must use absolute path.
2. Close the console window or type ^C to stop a chatroom service.
3. Browse URL(browser:IE4 or higher):
	http://[SERVER IP]:[chatroom port]/?USER=xxx&PASS=xxx
   Example log-in interface file is there named index_chat.html(change 0.0.0.0 in the file into your host IP address)

Files specification

2000.ini Chatroom config file
adminpass_2000.txt The file that log chatroom administrator's username and password(line   format:username|password|authority;
  Authority = 0, kick name,
  Authority = 1, kick name or IP,
  Authority = 9, kick name or IP, and can't be kicked
bchat.exe chat server daemon
top.htm The frame interface file of the chatroom
body.htm The interface file of viewing area of the room
bottom.htm The interface file of input area of the room
emote.txt The emote file name
filter.txt The obscene word filtering file
key1/key2 KEYs file
index_chat.html  Example file of log-in interface
language.txt(chinese.txt/chinesebig5.txt/english.txt)Language config file

IF you are running chatroom in INTRANET, no INTERNET connection,the following modifications are needed:
1. Please go to the URL http://bchat.yinsha.com/download , download file pack.zip , then unpack this file to a directory named "pack".
2. Confirm the web server service is running on the host.
3. Copy voice.cgi in the directory "pack" to the directory "cgi-bin" of the web server , then set the property of "executable" on(install perl to resolve it).
   Copy following files from sub-directory "image" in the directory "pack" to document root directory of web server:
   voice.htmemote.htmlCheck.classblueskyvoicee.dll
4. Modify top.htm , convert the string "http://202.96.140.88/voice.phtml" into "http://[IP address of host]/cgi-bin/voicee.cgi",
   convert the string "http://chat.yinsha.com/voice.htm" into "http://[IP address of host]/voice.htm",
      Modify bottom.htm: convert the string "http://www.yinsha.com/chat/emote1.html" into "http://[IP address of host]/emote.html",
   convert the string "http://202.96.140.88/check/" into "http://[IP address of host]/".
   

Please refer to the document under http://chat.yinsha.com for more directions and introductions.

