JayWormNET¶
JayWormNET is a lightweight Worms Armageddon WormNET server, which basically is a bundle of specialized HTTP and IRC servers. JayWormNET provided with such features as:
- Multi-channel support
- White and ban-lists
- Native W:A charset support
- Extended customization through scripting
Contents¶
Building JayWormNET¶
To build JayWormNET in automated way, you need JDK 7 and Apache Ant.
JayWormNET uses nProperty library to parse the main configuration file, so you need to download it first and put it into ‘lib’ directory. You can get it here.
Then, get into JayWormNET directory, and run ant. On Windows you can use ‘Shift + Right Click’ to quickly open cmd window by selecting it from context menu. Executable jar will be created in the ‘build’ folder. Before building, you may want to change JayWormNET’s default configuration files in ‘config’ directory.
Embedding configuration files¶
Usually, JayWormNET stores it’s configuration files inside it’s own .jar package. Any of them may be overridden by an external copy, placed to the current working directory. It’s a good practice (for convenient deploying) to pre-configure the server before the build right in the config directory, so once your .jar gets built, it already will be configured and ready for use.
See Configuration for further instructions.
Running¶
JayWormNET only requires Java SE 7.
With default settings (and HTTP port value unchanged on 80) on nix hosts it should be executed with root privileges. By default, it shows up GUI (when available) to let it be visible on graphical environment after you run it by double-click in file manager — GUI can be forced to be disabled by configuration file of by –nogui command-line flag.
Note about logging¶
Logging to file is disabled by default and you may set loggingEnabled = true in wnet.cfg file to enable it back. Log file (wn.log) will be written in the current working directory (when using desktop environment, it’s usually the same folder where jar is placed).
Configuration¶
Configuring JayWormNET isn’t a complicated task (until you ain’t going deeper to the scripting). There is a few configuration files, most of them have well-commented templates presented in the jar package or in the config directory. No one of them is necessary, as the default file set (mostly) represents JayWormNET’s hard-coded defaults.
The main configuration file¶
wnet.cfg
Example:
IRCPort = 6667
commandsEnabled = true
serverHost = example.com
By the way, this file is the only one which name can’t be changed (or even the file be moved).
This file is a set of variables with the simplest syntax suchVariable = true
per line.
Any unrecognized stuff (unknown variables, empty lines, symbols, etc.) is simply ignored,
so you can write comments in this file absolutely free. The only exception for commenting goes
for after-line-comments, which is not allowed and will cause your value to not be parsed properly.
Strings should be written as is, without "
or '
.
There are any possible variables listed below.
Generic variables¶
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
int | HTTPPort |
80 |
|
int | IRCPort |
6667 |
|
String | serverHost |
localhost |
Server host name, must be changed to your real server address |
int | gameLifeTime |
240 |
How long a hosted game should be kept in the list (in seconds) |
IRC-specific settings¶
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
boolean | useStealthIP |
true |
Hide real user’s IP by replacing it with stealthIP |
String | stealthIP |
no.address.for.you |
|
String | networkName |
||
String | charset |
native |
IRC charset (native , utf-8 , etc.) |
boolean | useIRCPassword |
true |
|
String | IRCPassword |
ELSILRACLIHP |
Default Worms Armageddon IRC password |
String | IRCOperPassword |
kenny |
Operator password, don’t forget to change it! |
int | specialMessagesPermissionLevel |
1 |
Who is able to use special green messages (0 nobody, 1, opers, 2 any) |
IRC pinging¶
Pings avoid non-responding or unexpectedly disconnected users stay on server by dropping them when the ping response timeout is reached.
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
boolean | pingsEnabled |
true |
|
int | pingInterval |
60 |
(in seconds) |
int | pingTimeout |
60 |
(in seconds) |
IRC login message settings¶
This section describes a configuration of messages, which client receives after successful login.
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
int | showIntro |
2 |
IRC login messages settings, can be 0 (nothing), 1 (short) or 2 (full) |
boolean | showCreated |
true |
Show server’s creation date in IRC login |
boolean | showPlayersCount |
true |
Show users count on IRC login |
boolean | showChannelsCount |
true |
Show channels count on IRC login |
boolean | showOps |
false |
Show operators count on IRC login |
boolean | showCapabilities |
true |
Send server capabilities on IRC login |
String | capPrefix |
(ov)@+ |
Capabilities settings, not recommended to touch |
String | capChanTypes |
# |
Capabilities settings, not recommended to touch |
String | capChanModes |
b,k,l,imnpst |
Capabilities settings, not recommended to touch |
IRC anti-flood¶
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
boolean | antiFloodEnabled |
true |
Avoid flooders by kicking them out |
int | floodGate |
1000 |
Flood tolerance |
int | floodMaxLevel |
4 |
Flood tolerance |
Message Of The Day settings¶
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
boolean | ircShowMOTD |
true |
Show IRC MOTD |
boolean | httpShowMOTD |
true |
Show HTTP MOTD |
String | ircMOTDFileName |
motd.txt |
|
String | httpMOTDFileName |
motd.html |
HTTP fallback settings¶
See Fallback page
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
boolean | httpFallbackEnabled |
false |
Enable custom fallback page |
String | httpFallbackPage |
fallback.html |
|
boolean | httpAlwaysReloadFallbackPage |
false |
Re-read the fallback page on every request |
Logging settings¶
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
boolean | loggingEnabled |
false |
Enable logging to file |
String | loggingLevel |
FINER |
See Java logging levels |
String | logFile |
wn.log |
|
boolean | announceGameHosting |
false |
Announce game hosting to the IRC channel |
boolean | showOperatorsActions |
true |
Show operator’s actions to other operators |
Lists¶
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
boolean | enableBanList |
false |
|
boolean | enableWhiteList |
false |
|
String | banListFileName |
banlist.csv |
|
String | whiteListFileName |
whitelist.csv |
|
String | channelsFileName |
channels.lst |
Path to IRC channels list |
String | commandsListFileName |
commands.lst |
Scripts configuration¶
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
boolean | masterScriptEnabled |
false |
|
String | masterScriptFileName |
master.js |
|
String | scriptedCommandsPrefix |
commands/ |
Path to scripted additional commands |
boolean | invocationWarningsEnabled |
false |
Log master script invocation failures, useful for debugging |
GUI settings¶
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
boolean | guiEnabled |
true |
|
String | guiBackgroundColor |
default |
|
String | guiForegroundColor |
default |
In-chat commands¶
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
boolean | commandsEnabled |
false |
Enable additional commands, affects scripted commands too (when false) |
boolean | scriptedCommandsEnabled |
false |
|
boolean | showCommandsInChat |
false |
WARNING: using of !oper command will result in password leak! |
boolean | swallowAllCommands |
false |
Overrides showCommandsInChat |
Various stuff¶
Type | Variable | Example / Defaults | Description / Notes |
---|---|---|---|
boolean | forceHosterIP |
false |
When a game hosted, it’s address will be replaced with hoster’s real IP |
boolean | enableSabotageProtection |
false |
Allows to close a game only from it’s hoster IP |
boolean | enableWheatSnooperSchemeFix |
true |
Fix for old versions of The Wheat Snooper, which were unable to join in |
boolean | enableURLSpellCheck |
false |
Experimental / undocumented stuff¶
Use with care!
Type | Variable | Example / Defaults |
---|---|---|
int | HTTPFailureSleepTime |
750 |
int | IRCFailureSleepTime |
2500 |
boolean | IRCSkipBytesWhenAvailable |
false |
boolean | dropIRCUserOnOverflow |
false |
int | IRCBufferSize |
262144 |
Ban-list and white-list¶
banlist.csv
whitelist.csv
Example:
Nickname, *
*, 192.168.1.10
mr_troll, 192.168.1.5 127.0.0.1
These lists are used for IRC server access restrictions. Ban-list prevents the listed clients to join, and vice-versa, white-list prevents non-listed clients to join (of course, when enabled). Both lists may be enabled and combined in use. Remember that ban-list has higher priority than the white-list.
Both files have the CSV-table (comma-separated values) format. There are two columns: Nickname and Address, and they are describing for whom the restrictions will be applied. The Nickname field can contain only one nickname or the * wildcard (affecting any nickname). The Address field can contain single IP, list of addresses separated by space or the * wildcard.
Channels list¶
channels.lst
Example:
Robots::Aperture Science
AnythingGoes:Pf,Be:Open channel, blah blah.
WormnetCrew:Pf,Be:
ProfessionalPootis::03 Ranked channel
This is the list of statically pre-defined IRC channels, presented as a table with three columns, separated by colons:
- Channel name (without
#
or something) - Game scheme (optional, defaulting to
Pf,Be
when is not present) - Channel description (optional)
You may set a channel icon by adding a two-digit number with space to beginning of channel’s description:
HelpChannel::05 Description
This file cannot be reloaded on-the-fly.
In-chat commands white-list¶
commands.lst
Example:
kick
oper
reload
This is a list of allowed for invocation IRC in-chat commands. It affects both the scripted and embedded commands. Non-white-listed commands will be “non-existent” even it is present. See In-chat commands.
Message of the Day¶
There are two MOTD files: txt is for IRC and html is the page being displayed at the right bottom in Worms Armageddon >= 3.7.0.0 on the channel selection menu.
motd.txt
Example:
I am the MOTD message!
motd.html
Example:
<center><FONT SIZE="2" COLOR="Yellow">
<BR>Welcome to JayWormNET server!
</FONT></center>
Fallback page¶
fallback.html
Fallback page is what HTTP client will receive, when trying to visit any non-WormNET (or simply non-existent) page (if enabled in configuration).
In-chat commands¶
JayWormNET’s IRC server supports in-chat commands (a.k.a. Additional commands), started from ”!”, for example, !foo bar
.
The commands should be enabled in the configuration file (see The main configuration file), otherwise you will just say it to chat;
also don’t forget to white-list required commands if it isn’t done yet: In-chat commands white-list.
Custom in-chat commands may be used to expand JayWormNET’s functionality. There are two kinds of them: embedded and scripted. First written in Java and comes as plugins (Java classes), which can be embedded in distributive jar or injected via modifying of Java’s Classpath variable. The second kind of commands are written in JavaScript and can be updated and re-evaluated on-the-fly.
Standard set of embedded commands¶
JayWormNET comes with a set of standard in-chat commands.
oper¶
Usage:
!oper <IRC operator password> [nickname]
Grants you with operator’s privileges, or that guy, which nickname you optionally specified. Repeating invocation of oper
revokes the privileges.
reload¶
Usage:
!reload
Used to (mostly) reload server’s configuration “on-the-fly”. Requires operator’s privileges.
say¶
Usage:
!say <some text>
Prints cool green message to the channel. Usage of this command can be restricted through changing of
specialMessagesPermissionLevel
variable in the configuration.