The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download | Blog
Personal tools

Modules/park

From Inspire IRCd (InspIRCd)

Jump to: navigation, search
Historical
This page has been marked as Historical. Information posted here may be inaccurate and out of date. This information is kept for sentimental and/or historical reference purposes. removed from 1.1 and only exists in the 1.0 implementation of InspIRCd.


Description

This advanced module allows users to 'park' and leave irc for short periods of time, to come back later and reclaim their previous channel status. A user must issue one command to park, in which case they are disconnected but their session remains as a "ghost", and then later must issue a second command with a key to unpark and resume their status.

This is ideal for networks which do not have services and do not plan to have services, because it allows users to maintain channel status even with an intermittent connection, so long as they know when they are going to be disconnected (for example users on timed dialups)

Configuration Tags

This module requires the following tag:
<park maxtime="60" maxperip="1" maxmessages="10">

The variables are specified as follows:

  • maxtime - The maximum amount of time in seconds a parked "ghost" will linger on IRC. Parked ghosts are not designed to be used like a bouncer, but may be used as such if you so wish. Therefore it is recommended you set the maximum time of the ghosts to a small number (for example 60) which is just long enough for a user to quit irc, go off and do whatever they must do (such as redial) and come back to unpark. If a user does not unpark within the time limit, the ghost is removed from the server, as shown below:
* Quits: MrParker (~brain@netadmin.chatspike.net) (PARK timeout)
  • maxperip - The maximum number of parked sessions one hostname can have. If you set this above one, beware, because it is possible to fill the server with parked sessions if this is incorrectly configured! If a user is over their limit of sessions the following message will be displayed if they should attempt to /PARK:
You are already parked up to the maximum number of allowed times.
  • maxmessages - This is the maximum number of private messages which will be stored for a user. By default this module will store private messages for parked users, sending them the list of saved messages when they reconnect. It is recommended to keep this figure reasonable or you will soon fill your servers RAM if this module is ever abused. A user who messages a parked user will receive the following message if they have message space left:
User MrParker is parked. Your message has been stored.

and the following message if they do not have space remaining:

User MrParker is parked, but their message queue is full. Message not saved.

Additional Modes

None

Additional Commands

/PARK

Parks the nickname which issues the command. The session's connection is closed, but the session remains as a ghost, to be reclaimed later. When the user quits, they will be given a key which is random, as shown below:

ERROR Closing link (~brain@synapse.brainbox.winbot.co.uk) [You are now parked. To unpark use /UNPARK TestPark2 1374576799]
/UNPARK <nickname> <key>

Unparks the nickname specified. The nickname must already be previously parked, and the key must match the one for this nickname. See the special notes for details of what actually happens when a user unparks.

/PARKSTATS   (Oper Only)

Displays the park module's statistics, as shown in the example below:

16:58 -test.chatspike.net- There are a total of 32 parked clients on this server,
with a maximum of 2 parked sessions allowed per user.

Special Notes

The UNPARK operation is a complex operation which involves duplicating and switching internal user records around. For those of you interested, and/or concerned as to how it might effect your client, here is a description of the process:
  1. The module first checks if the user is parked, if they are, it continues to the next step
  2. The module then checks if the key of the user against the one provided, if they key is correct, it continues to the next step
  3. The module then parts the user who issued the command from all of their channels so as not to confuse them or other clients which can see the user
  4. The module then sends a MODE line to the client to indicate it has removed all of that user's UMODEs
  5. The module duplicates and/or switches file descriptors on the two users, and disconnects the dead one (the real client which is now swapped with the parked client -- don't worry if you're confused now)
  6. The module then forces a nickchange on the user who issued the command forcing them to change to the nickname of the parked nick
  7. The user is then force joined into all the channels the parked nick is currently in, and sent names lists, topics etc as if they had joined themselves (similar to how NickServ autojoin works)
  8. The module then sends the parked user's UMODEs to give them the privilages of their new 'persona'
  9. Any away log messages are now spooled to the user.

From the perspective of other users, when you unpark, your active client will appear to part the channel, and your inactive client come back to life.