This is the lichat-serverlib Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 05:40:28 2024 GMT+0.
lichat-serverlib/lichat-serverlib.asd
lichat-serverlib/package.lisp
lichat-serverlib/server-objects.lisp
lichat-serverlib/server-operations.lisp
lichat-serverlib/connection-maintenance.lisp
lichat-serverlib/update-handlers.lisp
lichat-serverlib/emotes.lisp
lichat-serverlib/documentation.lisp
The main system appears first, followed by any subsystem dependency.
lichat-serverlib
Tools to help build a server using the lichat protocol.
Yukari Hafner <shinmera@tymoon.eu>
Yukari Hafner <shinmera@tymoon.eu>
(GIT https://github.com/Shirakumo/lichat-serverlib.git)
zlib
1.0.0
lichat-protocol
(system).
crypto-shortcuts
(system).
trivial-mimes
(system).
documentation-utils
(system).
package.lisp
(file).
server-objects.lisp
(file).
server-operations.lisp
(file).
connection-maintenance.lisp
(file).
update-handlers.lisp
(file).
emotes.lisp
(file).
documentation.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
lichat-serverlib/lichat-serverlib.asd
lichat-serverlib/package.lisp
lichat-serverlib/server-objects.lisp
lichat-serverlib/server-operations.lisp
lichat-serverlib/connection-maintenance.lisp
lichat-serverlib/update-handlers.lisp
lichat-serverlib/emotes.lisp
lichat-serverlib/documentation.lisp
lichat-serverlib/lichat-serverlib.asd
lichat-serverlib
(system).
lichat-serverlib/server-objects.lisp
package.lisp
(file).
lichat-serverlib
(system).
alive-p
(method).
allowed-content-types
(reader method).
(setf allowed-content-types)
(writer method).
backlog
(reader method).
(setf backlog)
(writer method).
backlogged-channel
(class).
channel
(class).
channels
(reader method).
(setf channels)
(writer method).
coerce-channelname
(function).
coerce-username
(function).
connection
(class).
default-read-limit
(reader method).
(setf default-read-limit)
(writer method).
find-channel
(method).
(setf find-channel)
(method).
find-profile
(method).
find-profile
(method).
(setf find-profile)
(method).
find-user
(method).
(setf find-user)
(method).
flood-frame
(reader method).
(setf flood-frame)
(writer method).
flood-limit
(reader method).
(setf flood-limit)
(writer method).
flood-protected-connection
(class).
flood-protected-server
(class).
frame-count
(reader method).
(setf frame-count)
(writer method).
idle-timeout
(reader method).
(setf idle-timeout)
(writer method).
initialize-instance
(method).
initialize-instance
(method).
initialize-instance
(method).
join-times
(reader method).
(setf join-times)
(writer method).
last-frame
(reader method).
(setf last-frame)
(writer method).
last-update
(reader method).
(setf last-update)
(writer method).
list-channels
(method).
list-profiles
(method).
list-users
(method).
make-channel
(method).
make-connection
(method).
make-connection
(method).
make-profile
(method).
make-user
(method).
password
(reader method).
(setf password)
(writer method).
password-valid-p
(generic function).
profile
(class).
profiles
(reader method).
(setf profiles)
(writer method).
read-limit
(reader method).
(setf read-limit)
(writer method).
remove-channel
(method).
remove-profile
(method).
remove-user
(method).
reset-timeout
(method).
server
(reader method).
(setf server)
(writer method).
(setf server)
(method).
server
(class).
start-timeout
(method).
timeout
(reader method).
(setf timeout)
(writer method).
timeoutable
(class).
user
(class).
users
(reader method).
(setf users)
(writer method).
make-ring
(function).
simple-profile
(class).
lichat-serverlib/server-operations.lisp
server-objects.lisp
(file).
lichat-serverlib
(system).
check-channel
(function).
check-channelname
(function).
check-from
(function).
check-permitted
(function).
check-target
(function).
create
(method).
init-connection
(method).
join
(method).
join
(method).
leave
(method).
leave
(method).
permitted
(function).
prep-perms
(function).
register
(method).
rule-permitted
(function).
teardown-connection
(method).
lichat-serverlib/connection-maintenance.lisp
server-operations.lisp
(file).
lichat-serverlib
(system).
check-connection-timeout
(method).
fail!
(function).
failure-args
(reader method).
failure-condition
(condition).
failure-type
(reader method).
pass-flood-gate
(method).
pass-flood-gate
(method).
process
(method).
process
(method).
process
(method).
send
(method).
send
(method).
send
(method).
send
(method).
send!
(compiler macro).
send!
(function).
fail!!
(function).
severe-failure-condition
(condition).
lichat-serverlib/update-handlers.lisp
connection-maintenance.lisp
(file).
lichat-serverlib
(system).
define-update-handler
(macro).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
process
(method).
lichat-serverlib/emotes.lisp
update-handlers.lisp
(file).
lichat-serverlib
(system).
*allowed-emote-content-types*
(special variable).
add-emote
(function).
add-emotes
(function).
emote
(function).
(setf emote)
(function).
process
(method).
remove-emote
(function).
*emotes*
(special variable).
coerce-emote
(function).
coerce-emote-data
(function).
lichat-serverlib/documentation.lisp
emotes.lisp
(file).
lichat-serverlib
(system).
Packages are listed by definition order.
lichat-serverlib
org.shirakumo.lichat.serverlib
common-lisp
.
*allowed-emote-content-types*
(special variable).
add-emote
(function).
add-emotes
(function).
alive-p
(generic function).
allowed-content-types
(generic reader).
(setf allowed-content-types)
(generic writer).
backlog
(generic reader).
(setf backlog)
(generic writer).
backlogged-channel
(class).
channel
(class).
channels
(generic reader).
(setf channels)
(generic writer).
check-channel
(function).
check-channelname
(function).
check-connection-timeout
(generic function).
check-from
(function).
check-permitted
(function).
check-target
(function).
coerce-channelname
(function).
coerce-username
(function).
connection
(class).
create
(generic function).
default-read-limit
(generic reader).
(setf default-read-limit)
(generic writer).
define-update-handler
(macro).
emote
(function).
(setf emote)
(function).
fail!
(function).
failure-args
(generic reader).
failure-condition
(condition).
failure-type
(generic reader).
find-channel
(generic function).
(setf find-channel)
(generic function).
find-profile
(generic function).
(setf find-profile)
(generic function).
find-user
(generic function).
(setf find-user)
(generic function).
flood-frame
(generic reader).
(setf flood-frame)
(generic writer).
flood-limit
(generic reader).
(setf flood-limit)
(generic writer).
flood-protected-connection
(class).
flood-protected-server
(class).
frame-count
(generic reader).
(setf frame-count)
(generic writer).
idle-timeout
(generic reader).
(setf idle-timeout)
(generic writer).
init-connection
(generic function).
join
(generic function).
join-times
(generic reader).
(setf join-times)
(generic writer).
last-frame
(generic reader).
(setf last-frame)
(generic writer).
last-update
(generic reader).
(setf last-update)
(generic writer).
leave
(generic function).
list-channels
(generic function).
list-profiles
(generic function).
list-users
(generic function).
make-channel
(generic function).
make-connection
(generic function).
make-profile
(generic function).
make-user
(generic function).
pass-flood-gate
(generic function).
password
(generic reader).
(setf password)
(generic writer).
password-valid-p
(generic function).
permitted
(function).
prep-perms
(function).
process
(generic function).
profile
(class).
profiles
(generic reader).
(setf profiles)
(generic writer).
read-limit
(generic reader).
(setf read-limit)
(generic writer).
register
(generic function).
remove-channel
(generic function).
remove-emote
(function).
remove-profile
(generic function).
remove-user
(generic function).
reset-timeout
(generic function).
rule-permitted
(function).
send
(generic function).
send!
(compiler macro).
send!
(function).
server
(generic reader).
(setf server)
(generic function).
server
(class).
start-timeout
(generic function).
teardown-connection
(generic function).
timeout
(generic reader).
(setf timeout)
(generic writer).
timeoutable
(class).
user
(class).
users
(generic reader).
(setf users)
(generic writer).
*emotes*
(special variable).
coerce-emote
(function).
coerce-emote-data
(function).
fail!!
(function).
make-ring
(function).
severe-failure-condition
(condition).
simple-profile
(class).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Easy wrapper to define a handler method for an update on a connection.
UPDATE is coerced to a symbol found in the LICHAT-PROTOCOL
package.
This creates a PROCESS method.
See PROCESS
Checks whether the CHANNEL field is a valid channel.
If the channel does not exist, a FAILURE-CONDITION for a
LICHAT-PROTOCOL:NO-SUCH-CHANNEL failure is signalled. If it
does exist, but the user is not a part of it, a FAILURE
CONDITION for a LICHAT-PROTOCOL:NOT-IN-CHANNEL failure is
signalled. Otherwise, the corresponding channel object is
returned.
This is in accordance with §5.1.5 §5.4.2 §5.4.3 §5.4.4 §5.4.5
See LICHAT-PROTOCOL:NO-SUCH-CHANNEL
See LICHAT-PROTOCOL:NOT-IN-CHANNEL
See FIND-CHANNEL
Checks whether the CHANNEL field has a valid, unused name.
If the channel name is malformed, a FAILURE-CONDITION for
a LICHAT-PROTOCOL:BAD-NAME failure is signalled. If it is
valid, but a channel of that name already exists, a FAILURE-
CONDITION for a LICHAT-PROTOCOL:CHANNELNAME-TAKEN failure is
signalled.
This is in accordance with §5.1.3 §5.3.2
See LICHAT-PROTOCOL:BAD-NAME
See LICHAT-PROTOCOL:CHANNELNAME-TAKEN
See FIND-CHANNEL
See LICHAT-PROTOCOL:CHANNELNAME-P
Checks whether the FROM field matches the update.
If it is not, a FAILURE-CONDITION for a LICHAT-PROTOCOL:
USERNAME-MISMATCH failure is signalled. If it is, the
corresponding user object is returned.
This is in accordance with §5.1.4
See LICHAT-PROTOCOL:USERNAME-MISMATCH
See FIND-USER
Checks whether the given update is permitted.
If it is not, a FAILURE-CONDITION for a LICHAT-PROTOCOL:
INSUFFICIENT-PERMISSIONS failure is signalled.
This is in accordance with §5.1.7
See PERMITTED
See LICHAT-PROTOCOL:INSUFFICIENT-PERMISSIONS
Checks whether the TARGET field is a valid user.
If it is not, a FAILURE-CONDITION for a LICHAT-PROTOCOL:
NO-SUCH-USER failure is signalled. If it is, the
corresponding user object is returned.
This is in accordance with §5.1.6
See LICHAT-PROTOCOL:NO-SUCH-USER
See FIND-USER
Attempt to coerce the name-ish to a channel name.
Valid types are:
LICHAT-PROTOCOL:CHANNEL-UPDATE
LICHAT-PROTOCOL:CHANNEL
STRING
Attempt to coerce the name-ish to a user name.
Valid types are:
LICHAT-PROTOCOL:UPDATE
LICHAT-PROTOCOL:USER
STRING
Signal a FAILURE-CONDITION that carries the designated failure and sends it off to the client.
See FAILURE-CONDITION
Returns true if the action on the channel by the user is permitted.
Action should be the class-name of an update.
See RULE-PERMITTED
See LICHAT-PROTOCOL:PERMISSIONS
Prepare the list of permissions rule for the registrant.
Checks whether the given rule allows the user of the given name access.
The rule evaluation is implemented according to §2.5
Convenience function to send an update to a connection.
Specifically, this will:
* Coerce the type-ish to a protocol type by looking the symbol
up in the lichat-protocol package.
* Add the :FROM initarg if it does not yet exist by using the
connection’s server’s name.
See SEND
Returns T if the object is still considered to be alive.
timeoutable
)) ¶backlogged-channel
)) ¶automatically generated reader method
backlogged-channel
)) ¶automatically generated writer method
Accessor to the hash-table of channels that exist on the server.
See SERVER
connection
)) ¶Creates an appropriate channel object for the registrant on the server.
If NAME is NIL, a random ID with an @ prefix is chosen
that does not already exist on the server.
If NAME is STRING= to the name of the server, a primary
channel is created.
Otherwise a regular channel is created.
This is in accordance to §2.4
Note that this will /not/ check whether a channel of the
given name already exists and will instead just replace
it.
See PREP-PERMS
See LICHAT-PROTOCOL:CREATE
See MAKE-CHANNEL
See FIND-CHANNEL
See LICHAT-PROTOCOL:*DEFAULT-ANONYMOUS-CHANNEL-PERMISSIONS*
See LICHAT-PROTOCOL:*DEFAULT-PRIMARY-CHANNEL-PERMISSIONS*
See LICHAT-PROTOCOL:*DEFAULT-REGULAR-CHANNEL-PERMISSIONS*
The initargs of the failure update that should be constructed to relay this error to the client.
See FAILURE-CONDITION
failure-condition
)) ¶The type of the failure update that should be constructed to relay this error to the client.
See FAILURE-CONDITION
failure-condition
)) ¶Accesses a channel by the given name-ish on the server.
See COERCE-CHANNELNAME
See CHANNELS
See REMOVE-CHANNEL
Accesses a profile by the given name-ish on the server.
See COERCE-USERNAME
See PROFILES
See REMOVE-PROFILE
Accesses a user by the given name-ish on the server.
See COERCE-USERNAME
See USERS
See REMOVE-USER
Accessor to the number of seconds for which a flood frame lasts.
See FLOOD-PROTECTED-SERVER
flood-protected-server
)) ¶automatically generated reader method
flood-protected-server
)) ¶automatically generated writer method
Accessor to the number of updates that can be received within a frame before the connection is limited.
See FLOOD-PROTECTED-SERVER
flood-protected-server
)) ¶automatically generated reader method
flood-protected-server
)) ¶automatically generated writer method
Accessor to the number of updates that were processed within the last frame.
See FLOOD-PROTECTED-CONNECTION
flood-protected-connection
)) ¶automatically generated reader method
flood-protected-connection
)) ¶automatically generated writer method
Accessor to the number of seconds a connection can be idle before it is considered timed out.
See SERVER
Registers the connection on the server and prepares it for use.
This corresponds to §4.1.8 to §4.1.12 with the additional
act that a related profile’s timeout is reset, if such a
profile is found.
See RESET-TIMEOUT
connection
) update) ¶Join a user to a channel.
Note that this will /not/ check whether the user is already in the channel or not and will just join them regardless.
A JOIN update is sent to all channel inhabitants, with the
given ID, or a fresh one if none is given.
The channel’s timeout is reset.
See LICHAT-PROTOCOL:JOIN
See LICHAT-PROTOCOL:NEXT-ID
See RESET-TIMEOUT
backlogged-channel
)) ¶automatically generated reader method
backlogged-channel
)) ¶automatically generated writer method
Accessor to the last frame number the connection handled.
See FLOOD-PROTECTED-CONNECTION
flood-protected-connection
)) ¶automatically generated reader method
flood-protected-connection
)) ¶automatically generated writer method
Accessor to the universal-time of when the last update was processed on the connection.
See CONNECTION
connection
)) ¶automatically generated reader method
connection
)) ¶automatically generated writer method
Leave a user from a channel.
Note that this will /not/ check whether the user actually is in the channel or not and will just leave them regardless.
A LEAVE update is sent to all channel inhabitants, with the
given ID, or a fresh one if none is given.
If no users remain, the channel’s timeout is started.
If NOTIFY-SELF is NIL, the LEAVE update is sent to every channel inhabitant other than the user leaving. Otherwise, the update is sent to everyone including the one leaving.
See LICHAT-PROTOCOL:LEAVE
See LICHAT-PROTOCOL:NEXT-ID
See START-TIMEOUT
Return a fresh list of all known channel objects for the server.
See CHANNEL
Return a fresh list of all known profile objects for the server.
See PROFILE
Construct an appropriate channel object for the server.
See CHANNEL
Construct an appropriate connection object for the server.
See CONNECTION
flood-protected-server
) &rest initargs) ¶Construct an appropriate user object for the server.
See PROFILE
Construct an appropriate user object for the server.
See USER
Updates flood information for the connection and returns whether the connection is fine or not.
See FLOOD-PROTECTED-CONNECTION
See PROCESS
flood-protected-connection
) (update update
)) ¶connection
) update) ¶simple-profile
)) ¶automatically generated reader method
simple-profile
)) ¶simple-profile
) password) ¶Process an update source on a connection.
Sources that are accepted:
* STREAM – An update is read from the stream
and sent off to PROCESS again.
* LICHAT-PROTOCOL:UPDATE – The update is handled accordingly.
If an error of type FAILURE-CONDITION is signalled during the
evaluation of non-around methods, the encapsulated failure update
is sent to the connection. If an error of type LICHAT-PROTOCOL:
PROTOCOL-CONDITION is signalled during the evaluation of non-around
methods, an update of type LICHAT-PROTOCOL:FAILURE is sent to the
connection.
A CONTINUE restart is established around the method that can be
used to respond with a generic LICHAT-PROTOCOL:UPDATE-FAILURE
and return from the PROCESS method.
This method will also take care to handle flooding and timeout
recording for the connection.
The overarching server must establish a restart called CLOSE-
CONNECTION around the PROCESS method, or around all calls of it.
When this restart is invoked, the server must close the underlying
connection.
See LICHAT-PROTOCOL:FROM-WIRE
See LICHAT-PROTOCOL:PROTOCOL-CONDITION
See LICHAT-PROTOCOL:UPDATE-FAILURE
See FAILURE-CONDITION
connection
) (update emotes
)) ¶connection
) (update data
)) ¶connection
) (update backfill
)) ¶connection
) (update user-info
)) ¶connection
) (update register
)) ¶connection
) (update permissions
)) ¶connection
) (update pull
)) ¶connection
) (update kick
)) ¶connection
) (update create
)) ¶connection
) (update users
)) ¶connection
) (update channels
)) ¶connection
) (update leave
)) ¶connection
) (update join
)) ¶connection
) (update message
)) ¶connection
) (update pong
)) ¶connection
) (update ping
)) ¶connection
) (update disconnect
)) ¶connection
) (update connect
)) ¶connection
) (update update
)) ¶flood-protected-connection
) (update update
)) ¶connection
) (stream stream
)) ¶Accessor to the hash-table of profiles that exist on the server.
See SERVER
connection
)) ¶automatically generated reader method
connection
)) ¶automatically generated writer method
Register a user profile.
Note that this will /not/ check whether the associated user
actually exists on the server or not and will just create
the profile regardless.
See FIND-PROFILE
See MAKE-PROFILE
See LICHAT-PROTOCOL:REGISTER
Removes the channel by the given name from the server.
See COERCE-CHANNELNAME
See CHANNELS
See FIND-CHANNEL
Removes the profile by the given name-ish from the server.
See COERCE-USERNAME
See PROFILES
See FIND-PROFILE
Removes the user by the given name-ish from the server.
See COERCE-USERNAME
See USERS
See FIND-USER
Resets the timeout to never occur.
See TIMEOUTABLE
timeoutable
)) ¶Send an update to a place.
Places that are accepted:
* CONNECTION – Directly sends the update over the wire. Note
that the primary method for this must be
implemented by the overarching server.
* USER – Relays the update to all connections of the user.
* CHANNEL – Relays the update to all users in the channel.
This function has to be called in a regular interval by the
overarching server. It will take care of handling connection
timeouts and will close the connection in case of one.
See CONNECTION
See USER
See CHANNEL
update
) (channel backlogged-channel
)) ¶object
) (connection connection
)) ¶Accessor to the connection’s server.
See CONNECTION
connection
)) ¶automatically generated reader method
connection
)) ¶connection
)) ¶automatically generated writer method
Starts the timeout by setting the object’s TIMEOUT slot to the correct time.
See TIMEOUTABLE
See LICHAT-PROTOCOL:LIFETIME
timeoutable
)) ¶Removes and cleans up the connection on the server.
This corresponds to §4.3.3 to §4.3.4 with the additional
act that a related profile’s timeout is started, if such a
profile is found.
See START-TIMEOUT
connection
)) ¶The universal-time by which the object will be invalidated, if any.
See TIMEOUTABLE
timeoutable
)) ¶automatically generated reader method
timeoutable
)) ¶automatically generated writer method
Accessor to the hash-table of users that exist on the server.
See SERVER
connection
) &key server) ¶simple-profile
) &key password) ¶Wrapper condition to carry a failure update.
See FAILURE-TYPE
See FAILURE-ARGS
See FAIL!
A server-side channel object.
See LICHAT-PROTOCOL:CHANNEL See TIMEOUTABLE
channel
.
timeoutable
.
The representation of a client connection.
See SERVER
See LAST-UPDATE
See LICHAT-PROTOCOL:CONNECTION
connection
.
check-connection-timeout
.
init-connection
.
initialize-instance
.
(setf last-update)
.
last-update
.
pass-flood-gate
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
process
.
(setf read-limit)
.
read-limit
.
send
.
(setf server)
.
(setf server)
.
server
.
teardown-connection
.
Initarg | Value |
---|---|
:server | nil |
:server
(get-universal-time)
:read-limit
A connection with basic time-frame flood-protection.
See CONNECTION
See LAST-FRAME
See FRAME-COUNT
A server with basic time-frame flood-protection.
See SERVER
See FLOOD-FRAME
See FLOOD-LIMIT
A server-side profile object
See LICHAT-PROTOCOL:PROFILE See TIMEOUTABLE
profile
.
timeoutable
.
An object representation of the server.
See USER
See USERS
See PROFILES
See CHANNELS
See IDLE-TIMEOUT
user
.
(setf allowed-content-types)
.
allowed-content-types
.
(setf channels)
.
channels
.
create
.
(setf default-read-limit)
.
default-read-limit
.
(setf find-channel)
.
find-channel
.
(setf find-profile)
.
find-profile
.
find-profile
.
(setf find-user)
.
find-user
.
(setf idle-timeout)
.
idle-timeout
.
initialize-instance
.
list-channels
.
list-profiles
.
list-users
.
make-channel
.
make-connection
.
make-profile
.
make-user
.
(setf profiles)
.
profiles
.
remove-channel
.
remove-profile
.
remove-user
.
(setf users)
.
users
.
Initarg | Value |
---|---|
:idle-timeout | 120 |
:allowed-content-types | nil |
:default-read-limit | nil |
(make-hash-table :test (quote equal))
(make-hash-table :test (quote equal))
(make-hash-table :test (quote equal))
:idle-timeout
:allowed-content-types
:default-read-limit
Superclass for objects that can be invalidated through a timeout.
See TIMEOUT
See START-TIMEOUT
See RESET-TIMEOUT
See ALIVE-P
:timeout
A server-side user object
See LICHAT-PROTOCOL:USER
user
.
Jump to: | (
A B C D E F G I J L M P R S T U |
---|
Jump to: | (
A B C D E F G I J L M P R S T U |
---|
Jump to: | *
A B C D F I J L P R S T U |
---|
Jump to: | *
A B C D F I J L P R S T U |
---|
Jump to: | B C D E F L P S T U |
---|
Jump to: | B C D E F L P S T U |
---|