English  Deutsch

Pichat Chat Configuration

Copyright © 2008 Piratson Technologies, http://www.piratson.se
Last update 09/May/2008 by Mark Seuffert

1. Introduction

Create your own chat system. You are able to adjust the chat to your personal taste, no matter if you just want to chat at home or run a public chat server.
This document is for advanced users and administrators who want to fine tune their chat and will provide you with information about customising and improving your chat services.

2. Prerequisites

Pichat is a software to communicate and exchange information. Its primary goals are comfort, privacy, stability and free information exchange. With this characteristics it fits well as private chat for friends, as a community chat system and for business support. A feature of Pichat is serving a variety of protocols and formats, allowing chats to be easily integrated and accessed from anywhere.
A chat service can be offered in the local network (LAN) and to the internet, last requires an online internet connection. Please be cautious when setting up a public chat, it's not recommend to run a public chat service without a proper firewall and regular software updates!

3.1. Web server

There is an integrated web server in Pichat which can be used for data exchange. You don't need to set up anything in order to use the web server and the webchat. However, you might want to customise your website and your webchat.
A web server has a so called root directory, only files inside this directory are available to others. Please copy files you want to share with any user into one folder (default is 'webserver/public/') and files you want to share only with registered users into another (default is 'webserver/private/'). This is great if you want to share files with your friends, but at the same time keep private files within a closer circle. You can of course organise your web server very differently, the names of all web server locations can be configured in the [Server] section of the INI file.
Examples:To access your web server go to...
 
http://127.0.0.1
http://myserver
First example accesses your own computer. In the second example 'myserver' is the public address of your web server. This could be the computer name inside a local network or a real hostname like 'pichat.no-ip.org'.
Notes: The web server logs all requests to a logfile using the 'combined logfile format' which many web servers use. The logfile contains downloaded files, referer (where the request came from), user agent (which program made the request) and more details. All user names and passwords are stored in a central file, you can use the user interface or the 'pipasswd' program to edit them. If you are interested in up-to-date traffic statistics see section 7.

3.2. Webchat arguments

Pichat has a built-in webchat with login page. Users can type in their nickname there and then enter the chat. Alternatively, it is possible to log in a user directly with a link to the webchat.
The webchat works with a wide range of web browser, no browser plugins required. Users get automatically the best functionality for their web browser, such as streaming chat output for modern browsers and simple text output for text browsers. Where available the webchat makes use of CSS, DOM and JavaScript.
Syntax:location?key=value[&key=value ...]
 
Arguments:
location=webserver location
key=name of argument, see below
value=value of argument
 
The following keys are supported in the webchat:
 
chatroom=name of chatroom (none for default chatroom)
colorscheme=name of color scheme (none for default color scheme)
language=language override, ISO639 (none for auto detect)
nickname=nickname of user
 
browser=browser type override (none for auto detect)
BROWSER_DYNAMIC = requires JavaScript, server push
BROWSER_SIMPLE = limited functionality, browser pull
BROWSER_UNSUPPORTED = browser not working in webchat
inputbar=show input bar? boolean value
navigationbar=show navigation bar? boolean value
sidebar=show side bar? boolean value
smileybar=show smiley bar? boolean value
streamforce=request extra stream updates? boolean value
for very stubborn web browsers and proxies
 
Arguments are either text or numerical. A 'boolean' value means the
value can be 0 (no/off) or 1 (yes/on).
 
Examples:http://myserver/chat
http://myserver/chat/connect?nickname=Moak
http://myserver/chat/connect?nickname=Vampire&colorscheme=night
Send a friend a link per email to enter your webchat with one click. Specify your friend's name (e.g. 'Moak') as shown in the examples above, please replace 'myserver' with the public address of your own server.
Notes: Values containing space or special characters have to be URL encoded as usual, for example like this: 'special%20characters'. All webchat pages follow the same syntax, the arguments 'colorscheme' and 'language' can be used with almost any webchat page.

3.3. Webchat templates

The webchat can be completely customised via HTML templates. Pichat comes with builtin template files, to change them copy new files into your webchat folder (default is 'webserver/chat/'), see [Server] section of the INI file. Only templates inside this folder will be used.
Here is a list of the main template files:
chat_help.htmlhelp page
chat_login_closed.htmllogin page when chat is closed
chat_login_members.htmllogin page when chat is for registered users only
chat_login_members_error.htmllogin page after invalid login
chat_login_open.htmllogin page when chat is open for any user
chat_login_open_error.htmllogin page after invalid login
chat_logout.htmllogout page
chat_session_error.htmlpage for outdated or failed session
frame_browser_dynamic.htmlframe start for standard web browser
frame_browser_simple.htmlframe start for simple web browser
frame_browser_unsupported.htmlframe start for unsupported web browser
frame_output.htmlframe with streaming chat output
location_home.htmldefault homepage
location_media.htmlchat media page for graphics and sounds
location_status.htmlchat status page
stylesheet_base.cssthe mother of all style sheets
There are typically more files used by start pages, e.g. for a navigation bar or creating a custom webchat layout. It's is good to have a look at existing webchat template packs and start with one as an example. You don't need to overwrite all template files (the builtin template pack consists of over 20 files), it's enough to overwrite single files.
For examples please see Pichat Downloads.
All webchat pages are dynamically generated by a builtin parser. This parser is the central tool for configuring a webchat. It looks in template files for text strings starting with '$' or '§' character (e.g. $nickname or §nickname) and then replaces them with text arguments. You can supply arguments either by appending them to the URL or with HTML forms. Arguments are available in two encodings, HTML encoded (for '$' text strings) and URL encoded (for '§' text strings).
The chat server offers additional arguments to the parser:
(Arguments marked with * are available both HTML and URL encoded)
$chat_alternate_stylesheetscolor schemes as style sheets, multiple lines
$chat_browser_type*detected browser type
$chat_chatroom_default*name of default chatroom, chat server entrance
$chat_chatroom_banned*name of chatroom for banned users
$chat_colorscheme*detected color scheme
$chat_colorscheme_graphicsset*graphics set of color scheme
$chat_commentcomment not visible in output, text in brackets
$chat_default_argumentsset defaults, comma separated list in brackets
$chat_forward_arguments*received arguments for HTML forms or HTML links
§chat_forward_arguments_cdatareceived arguments suitable for JavaScript links
$chat_forward_notdon't forward, comma separated list in brackets
$chat_interestskeywords with interests
$chat_language*detected language, ISO639
$chat_language_charset*charset of language (e.g. ISO-8859-1)
$chat_location_chat*web server location for webchat
$chat_location_media*web server location for graphics and sounds
$chat_location_status*web server location for status page
$chat_location_protected*web server location for password protected files
$chat_server_http_root*web server root directory
$chat_server_namechat server name
$chat_server_versionchat server version
$chat_server_welcomechat server welcome message
$chat_web_page_headerheader for web pages
$chat_web_page_footerfooter for web pages
$http_host*host address from HTTP request
$http_referer*referring address from HTTP request
$http_remote_addr*remote address of HTTP client/proxy
There are more arguments for a webchat session:
$chat_client_chatroom*current chatroom name
$chat_client_colorscheme*current color scheme name
$chat_client_language*current language, ISO639
$chat_client_nickname*current nickname of user
$chat_client_refreshtext 'refresh' or 'norefresh' for page refreshs
$chat_client_refresh_intervallintervall for page refreshs (seconds)
There are even more arguments when using the extended parser:
$chat_activitychat activity of last hour (percent)
$chat_activity_levelchat activity level as text (low/medium/high)
$chat_chatroom_numberpermanent chatroom number
$chat_chatroom_nameX*chatroom name (X = number of permanent chatroom)
$chat_chatroom_topicXchatroom topic (")
$chat_chatroom_user_listXchatroom users (")
$chat_chatroom_user_numberXchatroom user number (")
$chat_chatroom_user_whoXchatroom name and users (")
$chat_chatroom_user_infoXchatroom name and user number (")
$chat_chatroom_user_statuschatroom names and users, multiple lines
$chat_port_chatlistening port of chat server (TCP/UDP)
$chat_port_httplistening port of builtin web server (TCP)
$chat_server_dedicatedchat is running as dedicated server
$chat_server_modechat server mode (open/members/closed)
$chat_server_statuschat server status, multiple lines
$chat_server_status_userchat server status, user statistics
$chat_server_status_trafficchat server status, traffic statistics
$chat_server_status_shortchat server status, short summary
$chat_server_status_uptimechat server status, uptime
$chat_server_uptimetime chat server is running (seconds)
$chat_traffic_totaltotal traffic, chat plus web
$chat_traffic_receivedreceived traffic, chat plus web
$chat_traffic_sentsent out traffic, chat plus web
$chat_traffic_chat_receivedreceived traffic, chat server
$chat_traffic_chat_sentsent out traffic, chat server
$chat_traffic_web_receivedreceived traffic, web server and webchat
$chat_traffic_web_sentsent out traffic, web server and webchat
$chat_traffic_compressionoverall compression ratio (percent)
$chat_traffic_compression_leveloverall compression as text (low/medium/high)
$chat_user_numbercurrent user number
$chat_user_peakhighest user number since server was started
$chat_user_maxmaximum number of users allowed
$chat_user_servednumber of users served
Syntax:parser?file=filename[&key=value ...]
parser-extended?file=filename[&key=value ...]
 
Arguments:
filename=name of template file to be parsed
key=name of argument (appended to the URL)
value=value of argument (appended to the URL)
 
Examples:http://myserver/chat/parser?file=test.html
http://myserver/chat/parser?file=test.html&status=hello
http://myserver/chat/parser-extended?file=chat_server.rss
First and second example parses an HTML file. The third example calls the extended parser to generate a RSS feed (XML format). Please replace 'myserver' with the public address of your own server.
Notes: Keys without value will be ignored. A key with the postfix '_checkbox' will insert another key without the postfix. In case there are multiple keys with the same name the first one will win. Values appended to the URL containing space or special characters have to be URL encoded as usual, for example like this: 'special%20characters'. The parser works with any newline separated text file, you are not limited to HTML files. To preserve the '$' or '§' character in the parsed output use '$char' or '§char' in your template files. In order to prevent malicious code injection (Cross Side Scripting) browser supplied input to the parser is strictly sanitised, input is available both HTML and URL encoded.

3.4. Webchat style sheets

The webchat offers multiple style sheets with color information. Each style sheet can be extended with help of a CSS file. To add a CSS file copy it into your webchat folder (default is 'webserver/chat/'), see [Server] section of the INI file. Only style sheets inside this folder will be used.
Syntax:stylesheet_colorscheme_name.css
location/stylesheet?colorscheme=name
 
Arguments:
name=name of color scheme
location=webserver location
 
Examples:stylesheet_colorscheme_night.css
http://myserver/chat/stylesheet?colorscheme=night
First example shows the file name of a style sheet extension for the 'Night' color scheme. The second example shows the URL for the resulting style sheet. Please replace 'myserver' with the public address of your own server.
Notes: Style sheets are provided for all existing color schemes, for more information about color schemes see section 5.3. Graphics and backgrounds should be stored inside the media folder (default is 'webserver/chatmedia/').

4. Command line arguments

You can start Pichat with optional settings. Basically any INI file setting can be used as a command line argument, for a complete description of all settings see below in section 5.1. There is one additional command line argument with name 'IniFile' to specify the path of an INI file.
Syntax:filename -key[=value] [...]
filename /key[=value] [...]
 
Arguments:
key=name of argument (any INI file setting)
value=value of argument
 
Examples:pichat.exe -ServerDedicated
pichat.exe -Nickname=Vampire -ColorSchemeDefault=Night
pichatd -IniFile=/etc/pichat.ini
First example starts Pichat as dedicated server. The second example starts Pichat
with a different nickname and different color scheme. The third example starts a Linux chat server with the path to a specific INI file.
Notes: A key without value will be set to 1 (or yes/on for a boolean value). Values containing space have to be quoted like this: "text with whitespace". Command line arguments will override same settings in the INI file, but will not be saved to disk automatically.

5.1. INI file description

The INI file holds all your personal settings. It is called 'pichat.ini' and stored in your home directory, on Windows you'll find it in the Pichat folder (where your pichat.exe is). You need to start Pichat at least once to create an INI file, please restart Pichat after you have changed any of these settings.
Settings are either text or numerical. A 'boolean' value means the value can be 0 (no/off) or 1 (yes/on).
[Pichat]General settings:
VersionPichat version which created/updated this file
Nicknamenickname of user (ignored if dedicated server)
NicknameAlternativesalternative nicknames, comma separated text
StartupCommandscommmands to execute on startup, comma separated text
 
[Pichat Profile]Profile with information for others:
ServerNamechat server name, none to use your nickname
ServerVersionchat server version, none for current version
ServerAddresspublic address of your chat server, leave empty or
use a real hostname like 'pichat.no-ip.org'
Identificationunique identification, none to disable
Interestskeywords with interests, comma separated text
ServerDedicatedstart as dedicated server? boolean value
 
[Updates]Automatic software updates:
CheckForUpdatesregular check for updates? boolean value
DownloadUpdatesdownload updates? boolean value
UpdatesDownloadDirectorydirectory for storing updates
UpdatesRepositoryXURL of updates repository
(X = ascending number starting from 1)
 
[GUI]Graphical user interface:
AnimateSystrayanimate systray on traffic? boolean value
AnimateWindowTitleanimate title bar on message? boolean value
ShowFirstStartMessageshow newbie greeting on startup? boolean value
ShowSendButtonshow send button next to input? boolean value
ShowSideBarshow side bar next to output? boolean value
ShowAwayTimeshow away time? boolean value
InputLinesnumber of input lines (1-3)
SmileysAndGraphicsLevelshow smileys and graphics in chat (level 0-6)
0 = no smileys or graphics
1 = show smileys
2 = also taunts
3 = also symbols
4 = also flirt (hearts, kisses, flowers)
5 = also fun (coffee, alcohol, pizza)
6 = additional server logos (show all graphics)
SideBarLevelshow chatrooms and user list in side bar (level 0-2)
0 = show user list only
1 = show user list top, chatrooms below
2 = show chatrooms top, user list below
ChatroomTopicshow topic when joining chatrooms? boolean value
ChatroomUsersshow users when joining chatrooms? boolean value
ChatAdminCommandsshow commands from other chat admins? boolean value
only for chat admins
ChatServerUsersshow users entering/leaving the chat? boolean value
only for chat admin
PingPreciseshow ping and lag precise (1/10s)? boolean value
AutoAwayenable auto away? boolean value
AutoAwayLevelauto away will when be reseted (level 0-3)
0 = manual unaway only
1 = automatic unaway on public text
2 = automatic unaway on public text or command
3 = automatic unaway on (") or clicking chat window
AutoAwayAfteridle time to mark user away (seconds)
AutoAwayMessageauto away message
StdAwayMessagenormal away message
DndAwayMessageaway message for DND (Do Not Disturb)
DomkoTextFilterenable text filter in chat output? boolean value
NachoTimeStampshow time stamp in chat output? boolean value
NachoTimeStampLevelwhat gets time stamp (level 0-2)
0 = only private messages
1 = only private messages and chat text
2 = all text lines
NachoTimeStampMultiColorline color overrides time stamp? boolean value
NachoTimeStampHourshours format of time stamp, 12 or 24
NachoTimeStampPreciseprecise time stamp with seconds? boolean value
NicknameLevelnickname display (level 0-2)
0 = no colors
1 = nickname colored
2 = nickname colored with custom separator
NicknameSeparatorL2nickname separator (used in level 2 only)
Highlightenable highlighted text lines? boolean value
HighlightTexthighlight this text, comma separated text
HighlightMyNicknamehighlight if current nickname in text? boolean value
HighlightChatroomLevelhow to highlight normal chat text (level 0-11)
0 = do nothing
1 = colored text
2 = bold text
3 = colored and bold
4 = blink if not active chat window
5 = blink (") and colored text
6 = blink (") and bold text
7 = blink (") and colored and bold
8 = blink always
9 = blink (") and colored text
10 = blink (") and bold text
11 = blink (") and colored and bold
HighlightMessageLevelhow to highlight private messages (level 0-11),
same levels as normal chat text
HighlightFullLinehighlight full text line? boolean value
HighlightBlinkTimeblinking time for chat windows and systray (seconds)
TabsCloseButtonshow tabs with close button? boolean value
TabsWhenChatWindowNumbershow tabs when this number of chat windows exist
InputBufferinput lines, input history
OutputBufferoutput lines in chat window
ClearInputAndOutputclear input together with output? boolean value
FlickerFreeDrawingdraw flicker free with memory DC? boolean value
OpenNewBrowserWindowopen web page in new browser window? boolean value
UserAuthenticationuse stored user names and passwords? boolean value
UserAuthenticationFilefile with user names and passwords, login information
MainWindowTitleshow this text in title bar and systray
MainWindowStickymain window always on top? boolean value
MainWindowEscKeyMinimiseEsc key minimises main window? boolean value
MainWindowAnimateMinimisealways animate window when minimise? boolean value
MainWindowShareInputshare same input in main window? boolean value
MainWindowStatusViewmain window with status and contacts? boolean value
MainWindowOptionsmain window offers chat options? boolean value
MainWindowZoomedmain window zoomed out? boolean value
MainWindowPosposition and size of main window
MainWindowSplitterPosposition of splitter in main window
 
[GUI Connect List]Graphical user interface, connect list:
ContactGroupAddressesname of contact group (see contacts settings),
server addresses are added to the connect list
HistoryMaxmaximum number of history entries, 0 for none
hXserver address in history
(X = ascending number starting from 1)
 
[GUI Aliases]Graphical user interface, aliases:
aXalias and command, comma separated text
(X = ascending number starting from 1)
 
[GUI Sounds]Graphical user interface, sound effects:
EnableSoundEffectsenable sound effects? boolean value
sXchat action and sound file, comma separated text,
find a list of chat actions in section 6
(X = ascending number starting from 1)
 
[Server]Chat server settings:
PortChatlistening port of chat server (TCP/UDP)
PortHttplistening port of builtin web server (TCP),
set to 0 to disable web server and webchat
ServerHttpRootweb server root directory,
all web server locations are inside this directory
ServerHttpLocationChatweb server location for webchat
ServerHttpLocationMediaweb server location for graphics and sounds
ServerHttpLocationStatusweb server location for status page
ServerHttpLocationProtectedweb server location for password protected files,
files and subdirectories for registered users
ServerHttpMimeFileweb server MIME types file, none for builtin file
ServerChatLogfilechat server logfile, none to disable logging
ServerHttpLogfileweb server logfile, none to disable logging,
file name may contain time specifiers, see section 7
ServerAnnounceLocalNetworkannounce chat server in local network? boolean value
ServerDefaultHomepageweb server with a default homepage? boolean value
ServerDirectoryBrowsingweb server shows directory contents? boolean value
ServerHourStatuslog chat status every full hour? boolean value
ServerDebugModelog server debug information? boolean value
MaxUsersmaximum number of users in chat (overall)
MaxUsersTextchatmaximum number of text chat users
MaxUsersWebchatmaximum number of webchat users
MaxUsersPichatmaximum number of Pichat users
MaxSocketsmaximum number of incoming sockets per server
HandshakeWaitDnstime to wait for DNS resolution (seconds)
HandshakeTimeoutWelcometime until welcome message is shown (seconds)
HandshakeTimeouttime for handshake phase (seconds)
DisconnectTimeouttime for disconnect phase (seconds)
DataTransferTimeouttime to allow inactive data transfer (seconds)
DataTransferKeepAlivetime to wait for next data request (seconds)
DataTransferPersistentMaxmaximum number of data requests on same connection
DataTransferBufferSizesend buffer size for data transfer (bytes)
DataCompressionFileSizeMinminimum file size for on the fly compression (bytes)
DataCompressionFileSizeMaxmaximum file size for compression (bytes),
set to 0 to disable on the fly file compression
DataCompressionFilesExcludefiles to exclude from on the fly file compression,
comma separated file extensions
FollowXForwardedForIP address of reverse proxy for incoming traffic
WebchatBrowserDynamicweb browsers, comma separated list of user agents
WebchatBrowserSimpleweb browsers with limited functionality in webchat
WebchatBrowserUnsupportedweb browsers not working in webchat,
read more about browser types in section 3.2
WebchatSessionIpNetmaskallowed variation in session IP addresses (bits),
between 0 and 32, highest value to be most strict
WebchatStreamPaddingSizeinitial padding for streaming chat output (bytes),
required for stubborn web browsers and proxies
WebchatStreamForceIntervallintervall for extra stream updates (seconds),
activated only when requested in webchat session
WebchatPageRefreshIntervallintervall for page refreshs (seconds), used for
occasional updates of non-streaming chat output
WebchatSmileysAndGraphicsLevelsmileys and graphics for webchat (level 0-6)
0 = no smileys or graphics
1 = show smileys
2 = also taunts
3 = also symbols
4 = also flirt (hearts, kisses, flowers)
5 = also fun (coffee, alcohol, pizza)
6 = additional server logos (show all graphics)
WebchatScreenSizeBrowserSimplenumber of text lines shown in simple chat output,
used for simple web browsers
WebchatTextBreakLengthmaximum length of long text before breaking apart
WebchatLinkBreakLengthmaximum length of hyperlink text before shortening
WebchatEnableSoundEffectsenable sound effects in webchat? boolean value
WebchatEnableLagDetectionenable lag detection in webchat? boolean value
WebPageHeaderheader for server generated web pages
WebPageFooterfooter for server generated web pages,
usually address of the Pichat server software
DnsLookupEntriessize of DNS lookup buffer
DnsLookupThreadsmaximum number of DNS worker threads
DnsLookupTimeouttime for DNS resolution (seconds)
AnnounceNetworksbroadcast addresses for announces in local network,
comma separated text
AnnounceIntervallintervall for announces in local network (seconds)
PingPongIntervallintervall for connection tests (seconds)
ChatroomListUpdateIntervallintervall for chatroom list updates (seconds),
set to 0 for immediate update, not recommended
UserNumberUpdateIntervallintervall for server user number updates (seconds),
set to 0 for immediate update, not recommended
AwayUpdateIntervallintervall for away status updates (seconds),
set to 0 for immediate update, not recommended
AutoAwayTextchatLevelauto away will when be reseted (level 0-2)
0 = manual unaway only
1 = automatic unaway on public text
2 = automatic unaway on public text or command
AutoAwayTextchatAfterIdleidle time to mark text chat user away (seconds)
AutoQuitTextchatAfterIdleidle time to log out text chat user (seconds)
AutoAwayWebchatLevelauto away will when be reseted (level 0-2), see above
AutoAwayWebchatAfterIdleidle time to mark webchat user away (seconds)
AutoQuitWebchatAfterIdleidle time to log out webchat user (seconds)
AwayForceAfterIdleidle time until away status is forced (seconds),
setting any idle time to 0 disables a feature
 
[Server Permissions]Chat server, access permissions:
ChatModeDefaultdefault chat server mode when starting the chat
CHAT_OPEN = any user can enter the chat
CHAT_MEMBERS = only registered users can enter
CHAT_CLOSED = no new users can enter the chat
UserTypeDefaultdefault type for users entering the chat
USER_ZOMBIE = user with many restrictions
USER_VISITOR = user with some restrictions
USER_NORMAL = user without restrictions
VisitorRestrictionLevelrestrictions for visitors (level 0-3)
0 = allowed to talk with anyone
1 = can not send private messages to other visitors
2 = can not talk with other visitors
3 = can not talk with other users
VisitorRestrictionChatroomvistors can not change chatrooms? boolean value
VisitorRestrictionNicknamevistors can not change nickname? boolean value
UserPermissionsFilefile with user names and passwords,
you can use the 'pipasswd' program to edit them
SafeguardLoginFailedMaxmaximum number of failed login attempts per user name
SafeguardExpireTimesafe guard expire time (seconds)
ZombieQuitTimedefault time zombies are allowed to stay (seconds)
VisitorQuitTimedefault time visitors are allowed to stay (seconds)
NormalQuitTimedefault time users are allowed to stay (seconds)
ClosedQuitTimedefault quit time after chat was closed (seconds),
setting any quit time to 0 means unlimited time
ChatroomBanTimedefault time to be banned from a chatroom (seconds),
setting ban time to zero means unlimited ban
ChatroomAdminCanCreatechat admins can create new chatrooms? boolean value
ChatroomUserCanCreateusers can create new chatrooms? boolean value
ChatroomEnterInAnyusers can enter chat in any chatroom? boolean value
ChatroomDefaultname of default chatroom, the chat server entrance
ChatroomBannedname of chatroom for banned users
 
[Server Chatrooms]Chat server, permanent chatrooms:
cXchatroom name and topic, comma separated text
(X = ascending number starting from 1)
 
[Server MOTD]Chat server, message of the day:
mXtext line shown when users enter the chat, to target
only a specific language use a text beginning with a
language abbreviation and colon, e.g. 'de:' or 'en:'
(X = ascending number starting from 1)
 
[Server Actions]Chat server, chat actions:
ExternalProgramexternal program or script
eXchat action and command argument, comma separated,
find a list of chat actions in section 6
(X = ascending number starting from 1)
 
[Client]Chat client settings:
DefaultPortdefault port when connecting a chat server (TCP)
LagDetectionenable lag detection? boolean value
LagDetectionAboveserver ping time to identify lag (seconds)
LagDetectionFallBelowserver ping time to identify end of lag (seconds)
WelcomeMotdMaxmaximum MOTD lines shown with welcome message
DnsPendingNotifiesMaxmaximum number of pending DNS lookups
DnsHostnameFlushAgemaximum age of buffered hostnames (seconds)
ConnectTimeouttime to connect to server (seconds)
ConnectHandshakeTimeouttime to log-in on server (seconds)
ConnectRetryDelaydelay between automatic reconnects (seconds),
comma separated text
ConnectRetryLocalNetworkmaximum number of reconnects when a local network
connection was restored, set to 0 to disable
GhostSessionResurrectionregain session after disconnect? boolean value
PongAnswerTimeouttime to store last user pinged you (seconds)
KeepAliveIntervallintervall of sending keep alive (seconds)
DisabledCommandscommands which are filtered out, comma separated text
 
[Client Proxy]Chat client, proxy settings:
UseProxyuse local HTTP proxy? boolean value
ProxyAddressaddress of proxy
ProxyPortport of proxy (TCP)
ProxyResolveDnsproxy has to resolve hostnames? boolean value
ProxyBypassLocalNetworkbypass proxy for local addresses? boolean value
ProxyBypassHostsbypass proxy for some hosts, comma separated text
 
[Contacts]Contacts settings:
ContactGroupXgroup name and contact file, comma separated text,
find a description of contact files in section 5.2
(X = ascending number starting from 1)
 
[Color Schemes]Color scheme settings:
ColorSchemeDefaultname of default color scheme
ColorSchemePackXfile with additional color schemes,
find a description of file format in section 5.3
(X = ascending number starting from 1)
 
[Languages]Language settings:
LanguageGuiDefaultname of default user interface language
LanguagesPreferredlanguages preferred, comma separated list of names
LanguagePackXfile with additional languages,
find a description of file format in section 5.5
(X = ascending number starting from 1)
 
[3D Visualisation]3D window settings:
Widthwidth (pixel)
Heightheight (pixel)
ColorDepthcolor depth, 16 or 32 (bits)
FullScreenrun in full screen mode? boolean value
VisualisationLogfile3D visualisation logfile, none to disable logging
VisualisationLogLevel3D visualisation log verbosity (level 0-4)
Notes: To get fresh settings delete the file 'pichat.ini' and restart Pichat. Warning, you will lose your profile and all other personal settings! In case the INI file can not be created default settings are used.

5.2. Contact files

Pichat uses multiple contact files to store friends and people you want to stay in contact with. Each file stands for a single contact group. To add a new contact file download and copy it into your Pichat folder, then add file name to [Contacts] section of the INI file. Only contact files listed in the INI file will be loaded.
A contact file may contain multiple sections, each section describes one contact, sections not starting with 'Contact' are ignored.
Syntax:[Contact name]
ServerAddress=address
Description=text
Connect=connect
 
Arguments:
name=name of person or chat server
address=address of chat server including port number
text=text with optional description
connect=connect automatically on startup? boolean value
 
Example:[Contact Pichat Europe]
ServerAddress = eu.pichat.net:9009
Description = The default chat server in Europe
Connect = 1
This example defines a contact with a common chat server.
Notes: The first contact (without name) in a file describes the contact group, it contains a 'Description' setting only. All contacts are loaded on application start, duplicates within a group are ignored. If no contacts are found at all the following two contacts are added: 'Pichat Europe' and 'Pichat USA'.

5.3. Color scheme files

Pichat supports multiple color schemes, there are two builtin color schemes: 'Day' and 'Night'. To add new color schemes download and copy color scheme files into your Pichat folder and then add them to [Color Schemes] section of the INI file. Only color scheme packs listed in the INI file will be loaded.
A color scheme specifies colors, font and which graphics to use. A color scheme pack may contain multiple sections, each section describes one color scheme, sections not starting with 'ColorScheme' are ignored. It is not necessary to specify all settings for a new color scheme, you can also partly overwrite the basic colors (the basic colors look exactly like builtin color scheme 'Day').
Syntax:[ColorScheme name]
Colors=[colorname,R,G,B] [...]
Font=fontname, fontsize, fontsize-alternative
Graphics=graphicsset, graphicsset-selected
 
Arguments:
name=name of color scheme
colorname=name of individual color, see list below
R,G,B=red/green/blue values (0-255 each)
fontname=name of font
fontsize=size of font (point size)
fontsize-alternative=alternative size of font used in webchat
x-small, small, medium, large, x-large
graphicsset=graphics set for unselected text
1 = bright background
2 = dark background
graphicsset-selected=graphics set for selected text, see above
 
Here is a list of available color names:
 
COLOR_TEXT_BACKnormal background
COLOR_TEXT_NEUTRALnormal window text
COLOR_TEXT_CHATchat text
COLOR_TEXT_STATUSstatus text, neutral
COLOR_TEXT_STATUS_OKstatus text, positive
COLOR_TEXT_STATUS_WARNstatus text, negative or warning
COLOR_TEXT_LINKhyperlink
COLOR_TEXT_ACTIVELINKhyperlink activated
COLOR_TEXT_TIMESTAMPtime stamp (at beginning of text line)
COLOR_TEXT_NICKNAMEnickname (at beginning of text line)
COLOR_TEXT_OTHERtext from other users
COLOR_TEXT_HIGHLIGHThighlighted text
COLOR_TEXT_FILTERfiltered text
COLOR_TEXT_ALTBACKalternative background (in webchat pages)
COLOR_TEXT_ALTTEXTalternative text (in webchat pages)
COLOR_TEXT_SELECTBACKselected text background
COLOR_TEXT_SELECTTEXTselected text
COLOR_TEXT_INPUTBACKinput background
COLOR_TEXT_INPUTTEXTinput text
COLOR_TEXT_SIDEBACKside bar background
COLOR_TEXT_SIDEHEADINGside bar heading text
COLOR_TEXT_SIDETEXTside bar normal text
COLOR_TEXT_SIDEAWAYside bar away text (in user list)
COLOR_TEXT_SIDESELECTBACKselected side bar background
COLOR_TEXT_SIDESELECTTEXTselected side bar text
 
Example:[ColorScheme HelpDesk]
Colors=COLOR_TEXT_OTHER,200,0,000
This example shows text from other users in red. For more color scheme examples please see Pichat Downloads.
Notes: The builtin color schemes 'Day' and 'Night' can be freely customised. A color scheme is loaded from first color scheme pack which includes it, duplicates are ignored. All color schemes are loaded on application start, the webchat offers color schemes as alternate style sheets. Not all colors are available in the webchat, there are no colors for highlighted and selected text (web browser decides them). In a telnet text chat there are no color schemes at all due to technical limitations.

5.4. Graphic files

Pichat supports smileys and other graphics in the chat. To add new graphics copy graphic files into your media folder (default is 'webserver/chatmedia/'), see [Server] section of the INI file. Only files inside this folder will be used.
Chat graphics always exist in pairs, one graphic is used for bright color schemes and the other for dark color schemes. The first graphics set is aligned on white background with a white pixel border, the second on black background without border. This is necessary because not all platforms support graphics with gradual transparency.
File name:chatX_YYY.png or chatX_server_logoZZ.png
X is the number of the graphics set (1 or 2),
YYY is the abbreviation used in the chat,
ZZ is a two digit number between 01-99
Format:PNG (Portable Network Graphics) with any color depth,
a transparency color or alpha channel is required
Size:normal graphics use up to 14 pixel height, base line at 12,
the maximum width is 640 pixel, the maximum height is 64 pixel
 
Examples:chat1_rose.png chat2_rose.png
chat1_server_logo01.png chat2_server_logo01.png
First example lists file names for one of the builtin chat graphic, it's shown when you enter :rose: in the chat. The second example lists file names for a custom server logo, it's shown when you enter :server_logo01: in the chat.
Notes: The builtin chat graphics can be freely customised. You can also add up to ninty nine own chat graphics (server logos) which are typically used in the webchat. All chat graphics are verified on application start, make sure that you provide two matching graphic files for each chat graphic.

5.5. Language files

Pichat supports multiple languages, there are three builtin languages: English, German and Swedish. To add new languages download and copy language files into your Pichat folder, then add them to [Languages] section of the INI file. Only language packs listed in the INI file will be loaded.
A language pack may contain multiple sections, each section contains one language, sections not starting with 'Language' are ignored. Each section has to provide a complete set of text strings, you can not partly overwrite a language. Each language section starts with [Language name], where 'name' stands for the international abbreviation, e.g. 'de', 'en' or 'sv' (ISO639). A language section itself contains text lines only, the first line specifies the charset of the language, followed by two blocks for server and client text strings.
The user interface uses additional language resource files. On Windows they are named 'pichat_languageXXX.dll', where XXX is a three-letter code for the language (e.g. DEU for German, SVE for Swedish). From the available language resources the best matching will be automatically used.
For English reference files and more languages please see Pichat Downloads.
Notes: The builtin languages can be freely customised. A language is loaded from first language pack which includes it, duplicates are ignored. Languages are loaded on demand, which means a language is loaded the first time a client requests it. All language files should follow an informal and free style to match native expressions rather than strictly translating word by word. There is one exception to the rule, network error details shall remain in English, e.g. DNS and proxy errors.

6. Chat actions

Pichat offers chat actions to notify when something has happened. Chat actions are freely configurable, you can play sound effects or call an external program to perform a task.
Syntax:setting = chataction, text
 
Arguments:
setting=name of INI file setting
actionname=name of chat action, see list below
text=text with file name or command argument
 
Here is a list of available chat actions:
(Actions marked with * are for chat admins only)
 
CHAT_TEXTnormal text
CHAT_PRIVMESSAGEprivate message text
CHAT_NICKCHANGEnickname of chatroom user has changed
CHAT_USERMODECHANGEuser mode of chatroom user has changed
CHAT_AWAYCHANGEaway status of chatroom users has changed
CHAT_TOPICchatroom topic has changed
CHAT_USERNUMBERchatroom user number has changed
CHAT_JOINuser has joined chatroom
CHAT_LEAVEuser has left chatroom
CHAT_PINGping from user
CHAT_PONGpong from user, just 4 fun
CHAT_NETWORKnetwork status has changed
CHAT_SERVER_STATUSserver status has changed
CHAT_SERVER_USERNUMBERserver user number has changed
CHAT_SERVER_USERADD*server has one user more
CHAT_SERVER_USERREMOVE*server has one user less
CHAT_SERVER_ADMINLOGIN*chat admin has logged in
CHAT_SERVER_ADMINLOGOUT*chat admin has logged out
CHAT_SERVER_ONLINE*server goes online (your own chat server)
CHAT_SERVER_OFFLINE*server goes offline (your own chat server)
CHAT_PEER_ONLINE*peer goes online (in your local network)
CHAT_PEER_OFFLINE*peer goes offline (in your local network)
 
Examples:[GUI Sounds]
EnableSoundEffects=1
s1=CHAT_PING, default
s2=CHAT_PONG, default
s3=CHAT_SERVER_USERADD, sound_alert.wav
 
[Server Actions]
ExternalProgram=/usr/bin/esdplay
e1=CHAT_SERVER_USERADD, /usr/local/share/sound_alert.wav
First example lists the default sound effects and plays an additional sound when a new user enters the chat. The second example does similar on a Linux/BSD chat server.
Notes: Two sections in the INI file make use of chat actions, these are section [GUI Sounds] and [Server Actions]. Not all chat actions are available in section [Server Actions], only CHAT_SERVER_STATUS to CHAT_SERVER_OFFLINE can be used here. There are more chat actions used internally (e.g. for chat plugins), the ones listed here are in any case the most relevant.

7. Status, statistics and logfiles

Pichat delivers a chat status including user and traffic statistics. You can check the current status with command '/STATUS ALL' in the chat. Alternatively, status information are available as web page, RSS feed and written to logfiles.
Examples:To check your chat status as web page go to...
 
http://127.0.0.1/chatstatus
http://myserver/chatstatus
Here's a typical chat server status:
Moak's chat, chat server on port 9009, web server port 80
Welcome message is 'Welcome to Moak's chat'
Users 4 online, 6 peak, 100 max, 72 served, 38% activity (medium)
Traffic 5MB total, 1MB received, 4MB sent, 22% compression (low)
Uptime 6days 10hrs 53mins
User statistics show the current user occupation of a chat server, plus more information like the highest user number since server was started (peak value). There is also a chat activity of the last hour in percent, higher values mean more users are chatting actively. The chat activity is calculated from users chatting in chatrooms. Not taken into account for this calculation are private messages and users jumping between chatrooms without saying anything.
Traffic statistics list traffic since server was started. The total traffic is calculated as sum of all incoming and outgoing traffic (from chat server and web server). There is also an overall traffic compression ratio, higher values mean better compression. The chat server and the web server use data compression whenever possible to save bandwidth. Traffic can be compressed about 50%, but compression ratio drops with higher web traffic. This is not unusual because web traffic consists of a high proportion of media files (or lots of meta data) which can not be compressed very well.
Logfiles grow over time, you probably want to delete or archive old logfile entries. If a logfile setting in the INI file contains a time specifier the file will be reopened periodically and logging continues in a new file.
Example:[Server]
ServerChatLogfile=pichat_chatserver_%Y%m.log
ServerHttpLogfile=pichat_webserver_%Y%m.log
This example creates monthly changing server logfiles. All '%' time specifiers will be expanded according to the strftime function, for a description of time specifiers see strftime documentation (e.g. Linux manual pages). In our example the chat server logfile would be pichat_chatserver_200010.log in October 2000, then pichat_chatserver_200011.log and so on, similar for the web server logfile.
Notes: Logfiles will be reopened max every full hour. On Linux/BSD systems a SIGHUP signal will reopen logfiles instantly.
For further information and feedback please contact me.
See also: User Handbook, Developer Documentation, Features
Pichat is a simple to use peer to peer (P2P) chat software. It comes with integrated webchat, web server and chat server. The chat supports multiple chatrooms, text formatting with smileys and a user-friendly webchat (HTML, CSS, DOM, JavaScript). The webchat works with nearly any web browser, easily integrated and adjusted to your own web design, no PHP/Flash/Java required. Software for free information exchange for Linux and Windows.