						ssReborn
						========
						

Preface
-------
ssServer Reborn has various types of internal objects which can be accessed with
accompanied scripting language. This manual the scripting languge. All features
must be accessed and enabled with specific commands. When you start the server
it does nothing but accept commands from stanard input. 

This help file is not finished. Please see more details online at http://www.ufonurkka.mine.nu/forum/index.php

Command line parameters
------------------------
You can add initialization commands with command line parameters. These 
commands will be executed with the object that controls reading from standard 
input. So if you run 'chroot readers' with command line parameters the default
root will be changed when the control is given to std in. 

For example: ssReborn +"load loader.cfg" 
This would run load command on startup. The load command would load other 
settings to make the server operational. 

Commands can also be given in same format as they are accepted from any other 
reader. For example: ssReborn Echo "Loading settings"; load "loader.cfg"

Commands
--------
All commands and variables are case insensitive. 

Installing
==========

Quick install guide
-------------------

You probably have the server packet already extracted since you are reading 
this file. In config/ directory there are default configs. You should go thru 
all the configs and do your changes. Good place to start is config/loader.cfg 
which is a config that loads other config files and then process to 
config/exampleserver.cfg.

Linux:
To start the server run "./ssReborn.sh". If you get "Permission denied" error 
message "(-bash: ./ssReborn.sh: Permission denied" you must set execute flags
to the executable files. Run: "chmod u+x ssReborn ssReborn.sh". 

To shutdown the server run "killall ssReborn"

Windows: 
To start the server run ssReborn.bat

Mysql:
If you are going to use mysql you must install the mysql client too mysql.exe 
(mysql in linux) into your system (so that it can be found in PATH). If you 
have installed mysql server these are automaticly installed. If not, you need 
to copy the mysql.exe (mysql in linux) to the same directory as ssServer (or 
somewhere in PATH). This file is located in the mysql server package (in the 
mysql-server .zip somewhere along mysql-something/bin/mysql.exe). You don't 
need copy any other files from that that zip.

Testing:
There are two aliases that might come handy when testing the functionality
of the server.

Alias: fd     (Flood protection disable)
This alias removes the floodprotection. As default behaviour there is flood
procetection that prevents several connections from same IP in short time. 
This proctection might kick in when you test the server. So you can simply
run "fd" to disable it.

Alias: ts     (Test shotting)
If you run command "ts" to the server console it starts to take screen
shots more rapidly. The upload rate is also set to as high as possible. This 
way you don't need to wait minutes for the first screen shot. 

Objects
=======

Here is an example tree view to illustrate the relations of all objects

Object Type                                      Notes
-----------                                      -----

root                                             Root contains various global objects
 + log                                           All loggers can have multiple different kinds of writers
   + [1]/<Std out>                               Std out writer writes to console
   + [2]/<File out>                              File writer logs to files
   + [3]/<mysql out>                             Mysql writer sends log evens as mysql queries
   + [4]/<Udp out>                               Udp writer sends UDP packets
   + [5]/<HLrcon out>                            Hl Rcon writer sends half-life rcon packets
   + [6]/<Q3rcon out>                            Q3 Rcon writer sends Quake3 rcon packets
   + [7]/<ETrcon out>                            -""-
   + [8]/<MOHAArcon out>
   + [9]/<CODrcon out>
 + gameserver                                    Game server is the root of all configured game servers
   + var                                         Default variables for game servers
   + log                                         
   + [1]/<Half-life server>						 A object that controls a half-life server
     + var                                       Server variables that override default variables
     + log                                       Server logging
     + [1]/<player on server>                    This object represents a player playing on this server
       * client                                  A Reference to ssclient object
       + var                                     Information about this player
     + [2]/<another player on server[1]>         Another player on half-life server
       + var                                     Information about player
   + [2]/<Mohaa server>                          An object that controls a MOHAA server
     + var                                       Server variables that override default variables
     + log                                       Server logging
     + [1]/<player on server[2]>                 A Player on MOHAA server
       + var                                     Player's information
     + [2]</another player on server[2]>         Another player on MOHAA server
       + var                                     
 + ssServer                                      ssServer object
   + var                                         Variables to control ssClients, some of which can be overridden in gameserver variables
   + log                                         ssClient logging
   + [1]/<ssclient>                              Connected ssClient
     + var                                       ssClient's information
     * player                                    Reference to player [1] on half-life server
     * connection                                Reference to ssClient connection, under inpt
 + alias                                         This object controls global aliases
   <aliases>                                     List of aliases
 + lalias                                        This object controls local aliases
   <aliases>                                 
 + var                                           This object controls global variables
   <variables>
 + timer                                         This object controls list of timers
   + log                                         Logging 
   + [1]/<first timer>                           A timer that runs one or more commands on interval
     + var                                       Timer variables
     + log                                       Timer logging
   + [2]/<second timer>                          Another timer
     + var
     + log 	
 + input                                         List of all readers
   + [1]/<Std In reader>                         StdIn reader reads commands from console
     + log                                       Reader logger
   + [2]/<TCP listener>                          Tcp listener accepts tcp connections
     + log
     + IP Access                                 Controls IP based access
   + [3]/<UDP listener>                          Udp listener reads commands from UDP packets
     + log
     + IP Access                                 Controls IP based access
   + [4]/<File reader>                           File reader reads commands from file. This can be accessed with load command
     + log
   + [5]/<ssClient listener>                     ssClient listener accepts ssClient connections
     + log
     + IP Access                                 Controls IP based access
   + [6]/<Connection to TCP listener>            Tcp connection reads commands from tcp connection
     * log
   + [7]/<Connection to ssClient listener>       ssClient connections are referenced to client objects. They do not accept console commands
     * log
     * client                                    Reference to client object  


Variables
---------

Aliases
=======
There are global aliases and local aliases. Global aliases are valid everywhere
and are available for all connections. Local aliases are only live for the
connection and will be discarded on disconnect. Connectionless readers like 
UDP reader cannot have local aliases. Names of aliases cannot override any
commands. To access local aliases execute lalias.help and to access global 
aliases run alias.help.

Alias commands
--------------
alias.add <alias name> <command>    Creates a new alias
alias.remove <alias name>           Removes an alias
alias.list                          Returns list of all aliases

Example how to use aliases:
alias.add "welcome" "ssServer.all.write Welcome to ssServer"
welcome
alias.remove welcome

Timers
------
Timers execute commands repeatedly on an interval. 

To create a timer run:
Timer.Add <name> <count> <interval> <cmd>

<Count> is how many times the command is ran. To create an infinite timer set
count value to 0. 
<interval> is the time between each run.
<cmd> is the command to run on timer. You can use subcommands here. 

Newly created timer is disabled by default. To enable the timer execute .enable.

For example:
Var.TestMessage "Test"
Timer.Add TestTimer 5 1 Input.all.write `var.TestMessage´ 
Timer.TestTimer.Enable

This would output "Test" 5 times in 5 seconds.

Readers
-------

Writers
-------

ssClients
---------

Variables:



Gameservers
-----------

Other commands
--------------
