Tourist Guardian Bot for AW technology


Introduction

It's primary purpose to let the tourists build in a world with much more protection than AW currently have for tourist builds, encouraging them to register as a citizen.

My main goals were:
1, Assign the object built by tourist to that tourist (right now they are identified by name)
2, Disable assigned tourist object deletion by anyone else (actually the program rebuilds the deleted object)
3, Have a reporting facility for the world caretakers (World Keepers)
4, Provides privilege password solution for tourist.
5, Implement as much feature from the browser as much is possible (telegram, join, invite, etc.) .

This goal is accomplished by:
1, Implementing the full registry (encroachment, Building Inspector, etc)
2, Requiring tourists to sign in with their password. No tourist can build if they don't log in with their password!
3, Ryan and AWNewbie's users help by thoroughly testing it.
4, Month and month of programming work.

<back to top>

Features

First time visiting tourist can aquire a password  by whispering to the bot: password. The bot will generate an 8 character long password and a privilege password to the visitor which will identify him/her later.
Logged in tourist can register their email address with the bot so in case they forgot the password, they can ask for it with whispering mailpassword: to the bot and the bot will email it to the registered email addess.
Every time if the tourist enters the world and it's session number is different (probably logged off or changed name, etc) the bot will ask for his password.
In those possible cases when someone took the tourist original name, he/she can reclaim the building rights from that name by whispering to the bot: "Oldname":hispassword . This is fairly good security against impersonators.
Tourists can build in a team by sharing one of the team member's privilege password. The visitor can aquire the privilege of another tourist by whispering: takeprivilege:"Membername":memberprivpass.
The tourists and visitors can send telegrams to other tourists/visitors inworld. Those are not REAL telegrams but messages relayed by the bot. The telegrams are stored until the recipient asks for it. Tourists can have their telegrams emailed to their registered email address too. (Interworld telegramming is in the works now with the central password server operational)
Tourists and visitors can join/invite with the help of the bot. To avoid abusing those features, one can set his/her privacy settings to block / confirm those requests.
Tourists builds monitored by the encroachment algorithm effectively enforcing it on tourists objects without the need of the registry enabled in the world. This encroachment method takes into account the move and rotate commands and calculates its value accordingly. Named rotate/move commands are not implemented, so they are disabled by default.
There is a special feature not found in the AW browser: one can copy/paste a whole rectangle from one location to another one. This feature is not working interworld because other worlds have different OP, so the result would be questionable.
The bot can monitor/limit the special action commands like corona, refreshing pictures (update), sounds, etc which can cause severe lag if abused.
The bot can revoke the visitor's building rights if he/she does excessive building/deleting (too many objects within a given period).
GuardBot Version 3.1.1 and above has a central PasswordServer management enabled to consolidate all the guardbots running in separate worlds and universes. The server is on my main Linux machine - probably will run forever :)  ns1.andras.net, port:5670 .  Right now the database contains visitors from AWNewbie and Storage.
Update: From Version 4.3.1, the password server is moved to a different machine and using a different protocol which is not compatible with the older versions!
Extensive help responses through whisper.

<back to top>

Additional features

The bot can have a monitored IP list for troublemakers.
The caretakers can get all the visitors' enter/leave parameter like location, priv number usage, IP address and IP domain name
Instant visitor list within the bot's GUI or for the caretakers through command.
Caretakers has a plethora of commands to control the bot through whispering.
The bot can maintain a "WorldKeeper" on duty list and can build a sign inworld with the current on-duty WK-s name.
The basic tourist commands (like password aquiring, help, etc) can be assigned to clickable objects inworld, saving some whispers and teaching time.
The password database moved to a MySQL server, so the tourist telegramming will move there soon.

Other features can be added while I'm doing the development, so if you have something else in your mind, just tell me.


When you start the GuardBot (and the PwServer usage is enabled) it first loads it's local database, dumps it onto the server then reads the rest of the server.
Anytime a new password is assigned (or the email address changed) the bot refreshes the server.
Anytime a tourist enters, the bot checks the server for the most recent data.
It means the tourist can use the same password and email address in any guardbot protected world!

<back to top>

Requirements

Maximum world size the bot can handle is 3600x3600m (ps180) but the bot can be placed in any particular location of the world.
Memory requirement is about 150 MBytes when running that size of world.
Doesn't require too fast CPU (min 300 MHz)
Requires relatively fast path between the world server and itself (fast response time needed to seamless object protection)

Additional details can be found on AWNewbie's website: http://www.awcommunity.org/aws/awnewbie/guardbot.htm  Than you Ryan for the excellent work!

<back to top>

Configuring the bot

1, Configure the main bot features




2, Configuring the messages the bot tells to the tourists

(I'm working on an internationalization of this feature, so it could change significantly in the future)



The basic / default messages probably sufficient bout it is your world, so change it if you wish.
<back to top>

3, One should decide how much information wants to log.

 The Chat/Log Options menuitem is just for this purpose:



You probably want the Welcome Message checked but anything on this menu can be disabled.

4,  Configure the Initial Load parameters

- how should the bot aquire it's database, etc:



If you run the bot unattended 24/7, you want to enable the automatic start feature. If the bot encounters some fatal connection problem with the universe/world it tries to restart itself within a minute from scratch.
The world's database can be queried or if the world was once queried, the propload can be reloaded. Every time the bot exits, it saves the the world's database in it's propfile. if the query takes too much time, the proploading can be much faster but the bot can miss some building actions, so it is not necessary that the database is up to date with the world.
Visitor's Database contains all the visitors inworld, their password, email address and a list of the objects belonging to them. It should be enabled to load the database except if you want to start it from scratch.
Automatic save is a safety feature where the bot saves the database in every 0 minutes if it changes in a rotating logfile, so fatal crash should be survived with it.
<back to top>

5, Configuring the bot's running/location parameters




The greyed out fields are not changeable while the bot is running but the rest is.
Most of those fields are selfexplanatory, so I detail only the not so obvious ones:
Whisper Timer/Build Timer:
Your connection to the internet and the worldserver the bot connecting to have limitations. Unfortunately you just can't send all the messages at once and hope that the server and the client browsers are able to process them. To overcome of that problem, I introduced a throttling mechanism which limits the amount of traffic in a gentle way:
The bot is limiting the messages sent in a single burst by the #of whispers/objects per timer variables. The bot will send only so many such a message at once .
You can sepcify the timeframe between the whisper bursts and build bursts by those timers. None of them can be faster than 50 miliseconds. There is another (but hardcoded) limiting factor is the accumulated message length by a burst which is limited to 512 bytes effectively limiting the whisper bandwidth to a maximum 11 KBytes/sec.

ActAsBI will send the BI type of messages (encroachment, etc) as a consol message to the tourists.
Minimize Bot to System Tray will put it's little icon into the tray instead of the taskbar.
If you don't want to join to the guardbot networks then you can disable the PasswordServer's usage. The new MySQL based password server now available but external bot users have to contact me by email to give them access rights to the server.

A single bot can cover a P20 size area of the world. If you need larger coverage, you will need higher bot rights (can be purchased from AWI) e.g. a P100 world needs 25 bots to fully cover it.
There is a new feature under development that you can have one single global bot covering  your whole world. This feature is not fully tested yet. You select the "SingleGlobalBot" checkbox and pich the size you want to cover with it. There is a great disadvantage to have such single bot because AW browser visibility range is only 200m in any direction, so the visitors can't issue commands to the bot beyond that range.

If you want the bot to maintain the OnDuty sign, fill out the necessary fields where NS,WE and elevation is given in dekameters, negative values are South and East respectively. If you want to build under a different citizen's credential, change the "Duty Sign Owner" field to that person citizen number, otherwise keep it 0.



<back to top>

6, Configuring the monitoring/controlling features.


Those features are accessible through whisper commands too and they can be changed during the bot's operation.



The only field deserves a detailed explanation is the Unowned deletable and the Take Ownership functions:
There can be build while the bot is not online, so it know nothing about the new objects ownership. One can disable build totally if the bot is offline but that would be a pain. If you enable the deletion of the "unowned" objects, then people can work on their property even if the bot was offline.
TakeOwnership is a special action tourist can do: Right clicking (selecting) unowned objects takes the ownership to them (only of course if there is not encroachment). With those features enabled, the system can survive even a longer timeframe while the bot was offline :)
When the builders are building too fast (CTRL_selected zillions of objects and doing a fast copy operation) or attempting to delete too many foreign objects, the bot can revoke their building rights simply forcing them to log in again with their password. You can set the time interval for checking and the maximum number of objects within this interval to enforce the user slowdown.
By using the Report tab - you can enable various reporting for the caretakers:


<back to top>

7, Monitoring the visitors inworld by the bot

Click on the Show Visitor List button and you'll be greeted with the following window:



You can sort the list by clicking on the appropriate heading cell. Clicking twice on it will reverse the sort order.
Since you are connected to the central password server, it is a good idea to list only your local visitors by selecting the "LocalOnly" checkbox.
If you wish to automatically refresh the list, select th AutoRefresh checkbox. Don't set the refresh time too low (1-2 sec) because the refreshing can be a serious load on the CPU.
If you provide your AW browsers full path in the BrowserPath field - double clicking on the "Last Position" cell of a particular visitor will teleport you to that location.

<back to top>

8, The help messages from the source code.



Building Inspector Messages:
 You can not build until you have a password. ,
 Only registered objects can be used for construction ,
 You are not allowed to encroach into another's property ,
 You are only allowed to demolish your own property


Tourist help info:

The purpose of this bot is to protect tourists builds, introduce a few citizen options for the tourists.
Each tourist who want to build in this world should use a password provided by the bot, so the bot can identify the tourists properly.
Tourists can share building rights by using a privilege password.
Tourists can send and receive  telegrams  from other tourists or citizens while they are inworld.
You can control the Robot with the following commands whispered to him (note the colon after the commands!):

Tourist Command Help

Those commands control the bot for tourists.
    clickowner:        - Toggles the bot for reporting who is the owner of the clicked object.
    email:             - Registers your email address.
    invite:name        - To invite someone inworld.
    join:name          - To join to someone inworld.
    mailpassword:      - Mails your password to the registered email address.
    newpassword:       - Creates a new password set for you (in case the old is compromized).
    password:          - Tells you your password.
    privacy commands   - Manipulates your privacy options. Whisper help:privacy for details.
    privilege commands - Manipulates your building privilege. Whisper help:privilege for details.
    seed:objectname    - Builds a single object at the location you stand.
    summonwk:          - Asks the nearest WatchKeeper to join to you.
    telegram commands  - Manipulates your inworld telegrams. Whisper help:telegram for details.
    version:           - States the bot version number (though I don;t know why do you want to know it:).
    copy:north-westcoord:south-eastcoord       - Saves all the objects enclosed by the coordinate rectangle into your clipboard.
                        E.g. copy:4N 3W:2n 1E
    clear:             - Clears your current clipboard.
    paste:             - Builds your clipboard around the location you stand.


Privacy Help
                -      Command can abbreviated as prv:  parameters can abbreviated by their first letter.
    privacy:               - without parameters  you'll get your current settings listed.
    privacy:block:telegram - Toggles the telegrams blocking.
    prv:b:t                - Abbreviated form. Acts as above.
    privacy:block:join     - Toggles the join blocking.
    privacy:block:invite   - Toggles the invite blocking.
    privacy:confirm:join   - Toggles the join confirmation.
    privacy:confirm:invite - Toggles the invite confirmation.

Telegram Help
    telegram:   or   tg:      - To check if you have telegram(s).
    telegram:read   or   tg:r - To read one telegram.
    telegram:email            - To email all of your telegrams (if you have an email address registered with the bot).
    telegram:username:message - To send a telegram. Tourists name contains both \  (quotation) characters too!

Privilege Help
                 -      The privilege password enables you to build in a team with other tourists.
                 -      Once you take someone's privilege  the bot enables you to build on the same area the privilege owner builds.
    takeprivilege:              - Removes the privilege if you had one.
    takeprivilege:name:privpass - Takes the 'name' users building privilege if the privpass matches.
    tellprivilege:              - Tells you who's privilege are you on.


Citizen commands:
    TELEGRAM:       - manipulates your inworld telegrams. Whisper help:telegram for details.
    JOIN:username   - To join to someone inworld  citizen or tourist.
    INVITE:username - To invite someone inworld  citizen or tourist.
    PRIVACY:        - to toggle your privacy options. Whisper help:privacy for details.

Caretaker Help
    Caretaker commands (caretakers has access to all citizen commands too):
    HELPCIT/HELPT: - to get the citizen/tourist help.
    SAY:text to say by the closest bot to you.
    BROADCAST:text to say by ALL bots
    VERSION:   whispers the program's version number.
    ONDUTY:  or ON: - switches you on duty
    OFFDUTY:  or OFF: - switches you off duty
    DUTYSTATE:  or DUTY: - tells your WK duty state
    REPORT:reportflag  - toggles the report for the appropriate parameter. Whisper help:report for details.
    EJECT:citizenname - ejects citizen for 5 minutes if possible
    VISITORS: - list all current visitors inworld
    BOTS: - list all current bots inworld
    LISTONDUTY: - lists all WK's on duty (only citnames listed)
    CIT_NAME:citizennumber - reports the corresponding citizen name
    NAME_CIT:citizenname - reports the corresponding citizen number
    RESETPASSWORD:touristname - resets the tourist's password  so he can take another one.
    SENDPASSWORD:touristname - prints the tourist's password and sends it to the tourist too.
    GETPASSWORD:touristname - prints the tourist's password. Above commands' short form: resetpw:  sendpw:  getpw:
    For IP address related commands  whisper help:ip .

Caretaker Report options (any those parameters can be listed in the command and they can be abbreviated to 3 characters):
    enter      -  reports users enter/exit
    picture    -  reports users using 'picture' command
    corona     -  reports users using 'corona' command
    sound      -  reports users using 'sound' command
    update     -  reports users using 'update' command
    url        -  reports users using 'url' command
    media      -  reports users using 'media' command
    visible    -  reports users using 'visible' command
    delete     -  reports users deleting foreign object
    ipwatch    -  reports users on watched IP range
    namechanger-  reports users changing their names
    build      -  reports users doing excessive build
    erase      -  reports users doing excessive delete

BotControllers options:
    delete      -  disable deleting foreign objects
    tourist     -  disable deleting only tourist foreign objects
    unowned     -  enable deleting unowned objects
    takeowner   -  enable taking ownership of unowned objects by selecting it
    nopicture   -  disables using 'picture' command
    nocorona    -  disables using 'corona' command
    nosound     -  disables using 'sound' command
    noupdate    -  disables using 'update' command
    nourl       -  disables using 'URL' command
    nomedia     -  disables using 'media' command
    novisible   -  disables using 'visible' command
    slowdelete  -  enables fast deleters slow down
    slowbuild   -  enables fast builders slow down
    limitcorona -  Limits corona size


IPCommands
                 -      IP address and mask is given in xxx.xxx.xxx.xxx format
    IPNAME:citizenname        - checks the given citizen/tourist<needs both apostrophe!> name in the database and reports it's last IP
    IPCITNUM:citizennumber    - checks the given citizen number in the database and reports it's last IP
    ADDIPWATCH:subnet#mask    - to add IP range for alert
    DELETEIPWATCH:subnet#mask - delete IP range for alert
    LISTIPWATCH:subnet#mask   - list IP ranges for alert

<back to top>


9, Database format (if you want to create your own database)



--
-- Host: localhost    Database: Guardbot_PW
-- ------------------------------------------------------
-- Server version    4.1.9-standard-log

--
-- Table structure for table `Citizen`
--

CREATE TABLE Citizen (
  citnum int(11) NOT NULL default '0',
  last_enter datetime default NULL,
  create_time datetime default NULL,
  last_world char(8) default NULL,
  lang int(11) NOT NULL default '0',
  PRIMARY KEY  (citnum)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `Home`
--

CREATE TABLE Home (
  name char(24) NOT NULL default '',
  citnum int(11) NOT NULL default '0',
  world char(8) NOT NULL default '',
  x int(11) default NULL,
  y int(11) default NULL,
  z int(11) default NULL,
  yaw int(11) default NULL,
  PRIMARY KEY  (name,citnum,world)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `TldLanguage`
--

CREATE TABLE TldLanguage (
  tld char(8) NOT NULL default '.com',
  Lang enum('EN','NL','DE','FR','HU') default 'EN',
  PRIMARY KEY  (tld)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `TldLanguage`
--

INSERT INTO TldLanguage VALUES ('com','EN');
INSERT INTO TldLanguage VALUES ('uk','EN');
INSERT INTO TldLanguage VALUES ('at','DE');
INSERT INTO TldLanguage VALUES ('de','DE');
INSERT INTO TldLanguage VALUES ('nl','NL');
INSERT INTO TldLanguage VALUES ('fr','FR');
INSERT INTO TldLanguage VALUES ('be','FR');
INSERT INTO TldLanguage VALUES ('hu','HU');

--
-- Table structure for table `Visitor`
--

CREATE TABLE Visitor (
  name varchar(34) NOT NULL default '',
  `password` varchar(8) NOT NULL default '',
  privpass varchar(8) NOT NULL default '',
  email varchar(255) NOT NULL default '',
  last_enter datetime NOT NULL default '0000-00-00 00:00:00',
  create_time datetime NOT NULL default '0000-00-00 00:00:00',
  last_world varchar(8) NOT NULL default '',
  lang int(11) NOT NULL default '0',
  PRIMARY KEY  (name)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `World`
--

CREATE TABLE World (
  name char(10) NOT NULL default '',
  PRIMARY KEY  (name)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Download, Pricing and Version History

This program is not available for free any longer. Contact me if you are interested to buy this version.


World owner Pricing:
World size License fee Per user fee
P20 €100 €0.20
P40 €175 €0.30
P60 €300 €0.40
P100 €700 €0.50
P140 €1300 €0.60
Example: P30/20 €181 (175 + 20*0.3)

Latest commercial version: 7.3.2.167 (Windows/Linux)

7.3.2.167 (2/4/2008)
- fixed floating error where radius was not initialized
- listcaretakers now lists if someone is on CT privilege
- imlemented Limited CT feature
- Limited CT has no "eject", "say" and "broadcast" rights either

7.3.2.164
- fixed console only error message if invalid license
- fixed unexpected response for citizen attributes details

7.3.2.161
- fixed V4 data decoding from hexformat to binary
- added V4debug checkbox for listing all V4 parameters in the message log (production will have it invisible)
- replaced sscanf(wk,"%02x",(char*)) with sscanf(wk,"%02x",(int*)) codeguard was complaining under NT 4.0!!!

7.3.1.159
- fixed zero length PE in propdumps
- changed memset(dat,0,sizeof(dat)) to memset(dat,0,dtl) due to NT 4.0 memset problem - minimal length is 4 byes
- fixed missing zone size settings during propload

7.3.1.156 (1/27/2008)
- removed Camera checking from encroachment (invisible and could be needed for a distance zone view. It is still checked if someone else wants to delete it!
- added Particle Emitter checking with proper size calculations (emitter size + particle size) Particle size is a scale x y z RWX command
- added oversized objects (huge move or zone or particles) check/warning/delete

7.2.11.154 (1/24/2008)
-- merged with the Linux version (again) in hosting/storage/buildbot

7.2.10.153 (1/17/2008)
- Added Unowned and Owned props dumps for security reasons

7.2.9 150
- Fixed unresponsiveness under Windows 2003 Server

7.2.7 146
- AWNewbie release, SDK 66

7.2.6 145
- Lot restriction implementation

Version 7.2.4
- V4 windows version (based on the V4 Linux version!)
- CR/LF translation refined due to the Euro sign (0x80)
- propdump is now in V4 format
- objavatar.log is V4
- SDK 65 build

Version 6.0.1
- introduce world/uni/port/feature restriction based on the user LicenseKEY
    - license is issued to a single world/universe configuration for the selected features.
      each license makes the user eligible for unlimited updates within the issued major version
      conversion between major versions requires new licence on a discounted price.


Version 5.2.3 <5/28/2005>
    - Fixed Telegram send message if the bot is in Single Global Mode.

Version 5.2.2 <5/27/2005>
    - Fixed join/invite message if the bot is in Single Global Mode.

Version 5.1.9 <5/26/2005>
Version 5.1.1 <2/24/2005>
    - Added full multilanguage support. Up to 5 languages can be used right now but it can have more
       Each user can select his/her preferred language with the lang: command (provide the top level domain of the required country)

Version 5.0.2 <2/22/2005>
 
The following new features added to the guardbot:
1, change the world building rights through whisper (bot controller only):
    buildstop:  disables build
    buildrestore: restores previous build right list
    buildset:[list of citnums] sets the new building rights according the list provided.
2, Implemented the Bad/Suspicious world lists (caretaker function)
The default list files are guardbot.badwords.txt and guardbot.suspiciouswords.txt which can be changed in the ini file.
The file contains one world per line.
If the world stands without any qualifier, the bot trys to match the whole word.  I.e. "love" will match only with "love" but not with "beloved" and "lovely".
^ qualifier in front of the word means the bot matches up the the word is contained within the text.  I.e. "love" will match with "beloved" and "love" and "lovely".
* qualifier after the world means the bot will match only the beginning of each words in the string.  I.e. "love" will match with "love" and "lovely" but not with "beloved".
The bot can disable builds for those who use Bad words.
The bot can report to caretakers if someone uses Bad or Suspicious words.
Caretakers are able to add and delete words from both list:
    listbad:, listsusp: lists the words respectively.
    addbad:,addsusp: adds
    delbad:,delsusp: deletes words given as parameters

Version 5.0.1 <2/23/2004>
    - Implemented Cell Quota feature for tourists. Cell quota can be enforced or simply reported.


Version 5.0.0 <2/22/2004>
    - Added several messages to the configurable list, so they can be configured for any languages.


Latest free release version: 4.4.4

Version 4.4.4  <02/20/2006>
    - Fixed Duty Sign building when center bot is in global mode
    - Fixed "media" check collision with corona size checking.

Version 4.4.3  <05/28/2005>
    - Fixed join and telegram responses if the bot is a single global bot mode

Version 4.4.2  <02/16/2005>
    - Added reloadregistry: command so you don't have to restart the bot if you change the registry

Version 4.3.8  <02/14/2005>
    - Attempt to fix "ghost" avatars
    - Added wipe option to remove all "unowned" tourist objects
    - Added new propfile output after bot exit which contains all "unowned" tourist entries inworld

Version 4.3.7  <01/03/2005>
    - Fixed database update for existing Visitors.

Version 4.3.6  <01/02/2005>
    - Added password for the MySQL PasswordServer, so anyone who is using the main PW server please contact me!
    - Improved Database handling : the program now stores the last enter date and the creation date for tourists, so occasional purging is possible now!

Version 4.3.5  <10/23/2004>
    - Fixed "Unknown command" response when chat control is enabled.

Version 4.3.4  <10/23/2004>
    - Added password feature to the MySQL server access
    - added some retry mechanism when the bot is started but the world it wants to log in is not yet (e.g. both are on the same machine and after boot you are not sure of the sequence of those programs' start)

Version 4.3.1: <8/29/2004>
    - Added "media" checking
    - Moved the password server to MySQL database (Contact me if you want to use the common server - the default one is going out of business)

Version 4.2.5: <4/18/2004>
    - Added some missing/misleading hints

Version 4.2.4: <4/4/2004>
    - removed delete scores which added when someone tried to build with no authorizations (encroachment, no build rights, etc)
    - added visible off/no checking

Version 4.2.2:
    - Introduced control that users can instruct the bot through chat, not only with whispers. All commands issued in chat should prefixed with colon or slash ( :  /  ). This feature is useful if you use a single global bot for your world.
    - Added more checking for the "paste" command, so no object will go beyond the bot's jurisdiction.
    - Fixed the SingleGlobalBot's query which failed to get the edges of the covered territory.

Version 4.2.1:
    - Cosmetic change on the GUI
    - Added "Eject if on the watch list" option

Version 4.1.5:
    - Fixed query when the single bot queried a P20 world only
    - Fixed PwServerLog missing checkmark.

Version 4.1.4: (debug version is here)
    - added owner field to duty sign build

First released version 4.1.3 .

<back to top>