Intro
-----

So you have sucessfully compiled, confugured and run verlihub, congrats!!

Now I'll tell you how to kic, ban, setup hubs, slots stuff, and change settings on the run..

Kicking and banning user
------------------------

You know how to kick by mouse context menu, don't you? :o) Ok and now if you add some stuff to the kicking reason, you can do even more at the same time. There is a method in verlihub whih you kick and (temp)ban user in one action. It's the _ban_ (case insensitive) keyword and it's friends...

So if you have a fake share user you wold give for a reason something like this "fake share _ban_" or if you prefer "fake _ban_ share" or even "_ban_fake_share" whatever as long as there is _ban_ substring... User is kicked and banned ...

Of course you would like also to use temp ban, well that's similar..
e.g. "incomplete files, remove them and come back in a week _ban_1w" (you can use almost any simple time units ..)

time units:
second (s,S) minute (m, but NOT M), hour (h,H) , day (d, D), week (w, W), month (M but not m), year (y, Y).

You can use any resonable big positive integer in front of the time unit. Don't put spaces into the _ban_NUMBERUNIT stuff and it should work.

Note: a simple kicke gives itself a small temp_ban , 300 seconds by default, you can override it with the variable tban_kick = 60 for e.G. which would be a minute.

There are even the classic ways how to ban and unban, which work slight differently.
Important to know is that verlihub doesn't let you ban someone without a reason. First you must kick him and provide a reason, or you have to add a ban reason at the end of the ban command. 
e.g. !ban 1.2.3.4 Fake stare
!tempban 1.2.3.4 14d Sharing rotten tomatoes and bad sandwiches
or in case  you just have kicked the guy you need not to retype the reason, verlihub will take the one from kick. Note that this way you ban only ip address and not the nick. See next section (Ban methods)

Note: you can personalize the message that is send to a banned user that tries to login (msg_banned variable). Since verlihub banlist is on mysql database, you can create a php or similar site that let's user ask for unban if he feels innocent or whatever, and put the url in the msg_banned variable. A working example is on http://czpro.no-ip.com/unban .

Ban methods
-----------

Verlihub has a special banning scheme which gives a certain solution for users with shared or migrating ip, who often have bans for someone other. Simply every normal banis for IP and for Nick. Meaning if user matches ip or nick that is banned he can't go to hub. There is an exception which makes the scheme work better than the old ip scheme, and that is the lowest registration level. Every registered user ignores ip bans. And since there is a nick ban he can be banned too, by the nick, and if he would want to change the nick, then there is still the ip, so he would have to change both nick and ip. 
To resume: it's verified that it works ok..

To ban only nick or only ip there are also commands available:
ther is of course a new set of ban commands in 097, since all has been rewritten..
they start with
!ban or !unban !or !infoban
they continue with a type of ban, no type means the default (nick+ban)
the usage is described in the scripts/def_config/help_op file

it makes quite sufficient set of commands..

Note: you can also !kick and !drop users

some more:
!hidekick nick   - you can hide the public kick message from given user
config hide_all_kicks = 1 hides them all (0 doesn't)

Sending PM to multiple users:
-----------------------------

You have a choice,  ops can send pm's to OpChat (it's name may be set by config variable opchat_name ) that send the same to all other ops.

If you want to broadcast all over the hub, you can use command !broadcast (or shortcut !bc) followed byt the test of message, Every user in the hub then receives PM from hub_security user. If nywone writes pm to hub_security, at most one user will receive the response and it's the sender of last "broadcast message". Don't be surprised, even if you after !bc will send pm to hub_security you will receive your own echo.

There is also similar commands:
!regs and !ops which send broacast to corresponding users class..

Nominating OPs and regs from DC
-------------------------------

The important thing about velrihub is the ops hierarchy. Noone can nominate anyone of the same class, neither one less. Even regular ops (class 3) can't registrate anyone. So to be able to create registered user you need to be class 4 and higher, and as such you can make users of their_class <= your_class - 2. To create an op one needs to be class 5. Clear? There is nevertheless a possibility to create temporary op status or even higher. Temporary status may be given to his_temp_class <= your_class - 1.

Commands:
!regnewuser nick [class=1] (or shortcut !rn)
for temporary op status it's !class nick [class=3]

Setting password:
-----------------
once you !regnewuser a new command (+passwd his_new_pass) is available for him. He has then to use that command to set his access password. Without doing it he will have not the given status, and will be prompted to set the password on every login. The only thing that will work on him is the ip ban ignoring. So if someone asks you by other means to be regged because he has ban for someone else, you can do it, he can access hub and setup password.

e.g.
<TheBigOP> !rn UserName
<UserName> +passwd MyMumsName
<VerliHub> Your password has been updated successfully.
<Username> +passwd IChangedOpinion
<VerliHub> You can't do this, ask any op.
<AnyOP> !regpass UserName
<UserName> +passwd IChangedOpinion
<VerliHub> Your password has been updated successfully.

You can see, noone can change his password without someone higher knowing it. If any op wants to change pass, he must ask higher op for permission. If You, tha Master of hub want to change your password, you need to do it manually in the database or use some bash script.

!regclass nick newclass (or !rc) changes a class of already regged user.
!regdisable nick  disables user's registration without deleting it from database, useful for temporary purposes
!regenable nick
!regdelete  (should delete a user, but I never used it so it may not work :o)

DC Tags
-------

Verlihub also recognizes dc tags. You can configure the hubs and slots rules by means of following config variables:

tag_max_slots_default
tag_max_slots_28kbps
tag_max_slots_33kbps
tag_max_slots_56kbps
tag_max_slots_modem
tag_max_slots_isdn
tag_max_slots_cable
tag_max_slots_dsl
tag_max_slots_satellite
tag_max_slots_microwave
tag_max_slots_wireless
tag_max_slots_lant1
tag_max_slots_lant3

tag_min_slots_default
tag_min_slots_28kbps
tag_min_slots_33kbps
tag_min_slots_56kbps
tag_min_slots_modem
tag_min_slots_isdn
tag_min_slots_cable
tag_min_slots_dsl
tag_min_slots_satellite
tag_min_slots_microwave
tag_min_slots_wireless
tag_min_slots_lant1
tag_min_slots_lant3

tag_min_limit_default
tag_min_limit_28kbps
tag_min_limit_33kbps
tag_min_limit_56kbps
tag_min_limit_modem
tag_min_limit_isdn
tag_min_limit_cable
tag_min_limit_dsl
tag_min_limit_satellite
tag_min_limit_microwave
tag_min_limit_wireless
tag_min_limit_lant1
tag_min_limit_lant3

tag_min_ls_ratio_default
tag_min_ls_ratio_28kbps
tag_min_ls_ratio_33kbps
tag_min_ls_ratio_56kbps
tag_min_ls_ratio_modem
tag_min_ls_ratio_isdn
tag_min_ls_ratio_cable
tag_min_ls_ratio_dsl
tag_min_ls_ratio_satellite
tag_min_ls_ratio_microwave
tag_min_ls_ratio_wireless
tag_min_ls_ratio_lant1
tag_min_ls_ratio_lant3

tag_max_hs_ratio
tag_max_hubs

Explnanations:
--------------
_limit_ : those control upload limiters of users, units are kiloBytes per second nad numbers can be with decimal point
_ls_ratio_ : specify what is the minimum limiter per every open slot in kilobytes per second
usualy the min_limit tagsare higher then _ls_ratio_ and correspond to the first slots, and absolute minimum
you can thus say, that minimum limit is 10 but also 4 per each slot

you can sure tell the minimum number of slots per connection
also the maximum may be useful

You can add these to the config file. Defaults of these variables are either too low or too high for being restrictive.

You can also hide all tags from user descriptions, by another variable show_tags
to show them all to everybody, use show_tags = 2 to show them only to ops and hide tags from all normal users use show_tags = 1; hide tags by show_tags = 0 .
Remember also that op's tags are hidden for everyone. I think that they have no sense.

Hublist registering
-------------------

Verlihub has also a versy simple and a bit incomplete hublist registering support. It's TODO to make it better. Well there are several variables and one command that make it work. Those that are used are:
hublist_host - the ip address of the hublist registering host
hublist_port - usually 2501 which is default
hub_host
listen_port
hub_name
hub_desc
and the command is !hublist
you can use this command once above varibales are set correctly, but don't use it more often then in 15 minutes interval, hublists tend to ban hubs in this matter.


Triggers - User defined commands
--------------------------------

Verlihub has also this feature, which makes possible to show any text file on any specified command beginning with "+" sign. There is a mysql table called 'file_triggers' that contains definitions of these triggers. You can use provided script calles 'trigger' to create triggers in the database. The changes will take effect until invoking command !reload or hub restart.

Of course you can modify the trigger files on the runtime and the change sin file contents will take effect immediately. You can add your own script into crontab to modify the files...

TODO: triggers that do mysql queries and show the result, min delay for invoking triggers, and more

Share limits, nick chars, etc..
-------------------------------

You can personalise minimal and maximum share allowed in the hub. You can also set minimum and maximum allowed length of user's nickname. You can unallow certain characters in nicknames (ie. you can say which are allowed). 
Corresponding varibales are:
min_share
min_share_reg
min_share_ops
max_share 
...

min_nick
max_nick
nick_chars

You can also allow only users having specified nick_prefix or "[OP]" prefix...

Main chat controlling
---------------------

Verlihub has diverse parameters to protect chat from very bad flooding. There must be some compromise between heavy restrictions and possibility to chat.. So there are not yet all protections, and also because I have not done all of them.

Maximum length of chat message (max_chat_msg) and maximum number of lines in each message (max_chat_lines). Also minimum delay between two chat messages, which is currently in seconds, default is one. 
None of these restrictions apply on OPs.

You can also restrict given user from chat temporarily. Using command !gag nick will keep him out from chat until his reconnection of !ungag nick.

Sometimes you would also like to get rid of the kicking messages, specially when you use some bot that kicks very often. You can use a variable "hide_all_kicks = 1 or 0", 1 hides them all. Another possibility is !hidekick Nick and !unhidekick Nick.

There is nothing in verlihub that prevents user from saying
something
something
something
something
something
something
...

Well I use a dcgui-qt client that does this job automaticaly kicks user on such event.

Verlihub doesn't prevent users saying rude words. Anyway there is a possibility to configure verliBOT to kic/ban such users.. Besides you can teach verlibot to do quite intelligent conversation and be for someone hardly differing from human.

Hub redirection
---------------

You ca setup up to 10 hubs where verlihub will try to redirect every disconnected user. The choice is made randomly among all ten of them. If you want only one hub to redirect to you would set all ten of them to same hub address. varlibales are redir_host0 ... redir_host9.

TODO: mass redirection, spceialiezd redirection by type of disconnection (ban, kick, share_limit, country, etc...)

welcome messages
=================
in config they correspond to variables
msg_wellcome_*
- if you leave those empty nothing is sent
- if you put there some string it would be sent when VIP or higer user logs in the hub in public chat
- you can insert string "%[nick]" in it which would be replaced by user's nick
=======
----------------------------------------------------
  Commands
----------------------------------------------------

!quit
!hublist
!getconfig !gc
!userlimit !ul
!reload !re (new functions)
!broadcast !bc
!ccbroadcast !ccbc
!drop !dr
!class
!protect (overridden by !regprotect)
!kick !ki
!drop !dr
!getip !gi !gethost !gh !getinfo !gn
!help !?
!ops !oc (no more use since there is OpChat bot)
!regs
!hideme !hm (i dunno this exited)
!hidekick
!unhidekick
 



New commands
------------

CODE  
Commands like "ban"
all combinations of this....
(del|rm|un|info|list|ls)?ban(ip|nick|nickip|host1|host2|host3|prefix|share|email|...)

Examples:
---------
NOTE: 
- the best way to ban users if directly from the kick
- standard ban is by nick and by ip
- regged users are banned only by nick, that's usually why they are regged, becuase they share ip with others


* permbans
!ban <ip> <reason>
equivalent to
!banip <ip> <reason>
don't do !ban <nick> this will not work
!bannick <nick> <reason>
if you want to ban ip of a guy you just kicked and remmeber only nick, you can
!banip this nick <nick> <reason>

* temp bans
the commands are basicaly the same as for permbans, only you specify the amount of time right after the command part of your line ..
!ban_2H <ip> <reason>
!bannick_2W <nick> <reason>
other times .. <number><unit> ; 
<number> can be a natural 1, 2, 3 ...10, ..
<unit> a letter;  s (means second), m - minute, M - month, h or H - hour, .. (d, D,w, W, y, Y)

* other ban types
!banhost2 <hostname> <reason>  -- bans the second level of the given <hostname>
for example if you paste there www.somthing.com .. all that comes from somthing.com should be banned
!!important!! to make this work you need config var dns_lookup = 1, but is you don't have a fast dns server, 
this would slow down the hub, you may wait up to several seconds, even longer, on every user trying to login

!banhost2 ... - the highest level like .com etc .. not much of use i think ;)
!banhost3     - someuglynumbers.provider.whatever.com will take only provider.whatever.com and this part would be banned
!banhostr1    - bans the leftmost part of the hostname in upper case it's the "someuglynumbers"

!banprefix <nickprefix> <reason> -- should ban all nick starting with <nickprefix> 
!!!NOTE!!! this one will be slow, the more prefixes you ban the slower it will be, test and see ;)

!banshare  -- exact share size in bytes
!banemail  -- email from the MyINFO

!banrange <ipmin>..<ipmax> <reason>
!banrange <ip>/<left_mask_bits> <reason>
!! NOTE !! this will probably not work fine on big-endian machines

* getting info about bans
!infoban <nick_or_ip_or_whatever> -- equivalent command is !listban
-- tries to list all possible matches 
if you wanna specify closer what kinds of bans you wanna chose then use one of above mentioned suffixes
!infobannnick <nick>
!infobanip <ip>
!infobanrange <any_ip_from_the_range>
etc..


* unban rmban or what you wanna call it ;)
-- these commands have similar syntax to the !infoban ones
!!!! YOU HAVE TO PROVIDE A UNBAN-REASON if you wanna unban , the reasons may vary, you can put whatever, even a dot "." is accepted
-- unbans are stored in database, master can then vieuw them and see if someone sabotages the hub ;o)
!unban <ip_or_nick> <unban_reason>
!unbanip -- will remove only existing ipbans (not that standard type of ban is 'nickip' which would stay in this case (maybe, test and see)
!unbannick -- removes nickbans
!unbanhost2

( don't read this : -- note, syntax !unban<bantype>_<bantime> ... is allowed but makes no difference to those without <bantime> )

======================
Commands like "gag"
all combinations of this....
(un)?(gag|nochat|nosearch|nopm|noctm|....)

======================
Commands like "trigger"
(ft|trigger)(edit)
only this one for now (ftedit or triggeredit)

======================
Commands like "set"
!set or !=

Commands like "cmd"
todo (should list description of these groups)

===========================
Commands like "reg"
!reg or just !r followed by one of :  "n","new","newuser", "del","delete", "pass","passwd", "enable", "disable", "class", "setclass", "protect", "protectclass", "hidekick", "hidekickclass", "set","=", "info" 

Details:
---------
with these command you can create, modify, delete, getinfo  .. registered users
- to do any kind of creation or modification, you need to be authorized to
(usually class 4 ops have the rights)
- to get info, you only need to be op
- deleting regs is privilege of class 5 users and higher
- again these commands have some shortcuts (eg. instead of !regnew you can write !rn, etc, see above)

!reginfo <nick> // info about a regged user
!regnew <newnick> [<class>] //e.g. !rn [VIP]Verliba 2
- after the regnew, the user is immediately prompted to set password (if he's online, or as soo as he gets online)
- until he sets the password he has no privileges except not being banned by ip ..
- you can setup a password for user yourself
- users that has not set password can't stay in hub any longer then N-minutes (N=5)
- once they setup password they need to relogin to get their privileges
 

!regdel <nick> // !rdel [VIP]Verliba
!regclass <nick> <newclass> // changes user's class e.g: !rclass [VIP]Verliba 3
!regset <nick> note_op <This is my friend, that's why I regged him>
!regprotect <nick> <protect_class> //protect against accidental kicks etc..

- password
!regpass <nick> // allowes and forces user to change a password
!regpass <nick> <password> // you change the pass for users
- this is useful specialy for dumbs or VIPs that can't get in hub to set their password
when user wants to change a password himself
:1: he must be authorized to do so (!rpass <nick> , or just after !rn <nick>)
:2: use command +passwd <password>  (this may be sent to PM of the HUb-security, as well as to the main chat)
- no chat lines starting by '+' are shown in the public chat, but if you put spaces before it, it would show up there


whatelse did I forget ???
oh yes, hiding kicks, for ops only .. that means when opkicks the message <nick> ik kicking <othernick> because: blabla
is not shown in chat ..
!reghidekick <nick> <max class for hiding> // tell me if that does not work ;)
also if you don't wanna show this stuff at all use != hide_all_kicks 1


===========================
Commands like "info"
!hubinfo // displays some basic statistics about the hub
-- for more stats, use plugin "stats"

===========================
Commands like "proto"
!proto followed by one of (all|active|hello|op ..., user) 
and then by one of _hubname _any ....

!protoall_hubname <newhubname>
!protoall_quit MyNIck // pretend leaving hub
..

!protoall_hubname (sends the parameter as a hubname to all users)
!protoall_hello (simulates a new login
!protoall_quit (simulates a lgout
!protoall_pm ( sends a pm like in !bc command
!protoall_chat (sends a chat like if you type it directly into main chat
!protoall_redir (send a forcemove command, without any PM)
!protoall_any (you can try anything here, the pipe is added to the end automaticaly)

same with
!protohello_* (send only to users that don't support NoHello feeature, which reduces bandwidth
!protoactive_* (sends only to active users)
!protouser_* (this one is todo...) 

======================
Commands like "who"
!whoip !whorange or !wip !wrange

!whoip 127.0.0.1
!whorange <ip>..<ipma>
!whorange <ip>/<left_mask_bits>

======================
Commands like "kick"
!kick  (the older one is used)
!drop  (the older one is used)
!flood 

!kick <nick> <reason> // in reason you can put _ban_<bantime> which would also ban user immediately
!drop <nick> // should not ban him, (tell me if it does)

=======================
Commands like "plug"

!plugin <plugin_filename.so>
!pluglist all
!plugout <pluginName>
!plugreload <pluginname>

======================
Commands for regular users
(some may yet not work correctly, I only put them here so I would not forget to document them)
+me - replaces +me by his nick and sends as a chat message
+myinfo - gives user some info about himself
+myip - gives user his ip
+report - sends message to ops
+regme - sends message to ops

