Sebastian Crane
91cbdb69da
Simplify the system start and restart functions
...
This commit changes the binding name of system/start's argument to
_ (since it is currently not used within the function), and simplifies
the system/restart function by not swapping the system Var's content
with nil before filling it with the new-created system state.
Eventually, these changes will be reverted when the initialisation of
the system is separated from the starting of that system, which will
mean that system/start will read its argument and that system/restart
will have to reinitialise the system state before restarting it.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-03-24 21:51:06 +00:00
Sebastian Crane
fecd09c656
Remove unnecessary system/system function
...
A nil value acts as an empty map wherever a map value is expected. For
this reason, this commit removes the system/system function (which
returns an empty map), since a call to it can safely be replaced with a
nil value.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-03-22 22:51:59 +00:00
Sebastian Crane
0abd793fe7
Use a Var instead of an Atom for system state
...
The Atom's swap! function may run its provided function multiple
times. Because of this, using an Atom for the system state can
occasionally result in duplicate TCP connections being opened when the
system is started. These connections remain open until they
timeout (this is typically 5 minutes for IRC).
This commit changes the container for the system state from an Atom to a
Var, whose alter-var-root function (analogous to swap!) does not have
this issue.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-03-22 22:47:00 +00:00
Sebastian Crane
56094478db
Remove use of state container in main function
...
Since the main function will only ever start and stop one system, this
commit simplifies the main function to use a single lexical binding for
the system state rather than creating an Atom.
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-03-22 22:38:30 +00:00
Sebastian Crane
856432516c
Release version 1.0.0
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-03-03 21:48:53 +00:00
Sebastian Crane
293fa41d3b
Fix exception when dispatch-command returns nil
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-28 21:09:05 +00:00
Sebastian Crane
8502f6980d
Add section about licensing to CONTRIBUTING.md
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-28 18:10:13 +00:00
Sebastian Crane
c77276efdd
Add CONTRIBUTING.md document
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-28 17:38:35 +00:00
Sebastian Crane
9a5f7df7a4
Add README.md
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-28 17:38:35 +00:00
Sebastian Crane
a180f7927e
Use IRC nick as default IRC 'real name'
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-28 17:38:35 +00:00
Sebastian Crane
71deb2c91d
Add !help IRC command
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-27 21:53:45 +00:00
Sebastian Crane
55379e1e81
Add support for sending multi-line IRC messages
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-27 21:52:07 +00:00
Sebastian Crane
2f27cb8a86
Omit sender of !match command from players list
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-26 23:34:38 +00:00
Sebastian Crane
d9dc7acd34
Refactor response functions to use 'as->' macro
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-26 23:18:19 +00:00
Sebastian Crane
e4df11f12d
Use case-insensitive sorting when listing players
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-23 21:30:57 +00:00
Sebastian Crane
c5a70954c3
Factor out keywordise-game function
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-23 21:23:34 +00:00
Sebastian Crane
7857a1acf5
Add main function
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-19 23:33:01 +00:00
Sebastian Crane
a2a041c9d1
Add 'Reloaded' system for interactive development
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-19 23:18:53 +00:00
Sebastian Crane
aacf1cad28
Add IRC connection functionality
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-19 22:32:43 +00:00
Sebastian Crane
fe660a8929
Add support for loading state and config files
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-19 21:42:35 +00:00
Sebastian Crane
3f8c150964
Add clj-commons/clj-yaml to dependencies
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-18 22:09:27 +00:00
Sebastian Crane
029722b52e
Add clojure.data.json to dependencies
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-18 22:08:22 +00:00
Sebastian Crane
c1572ed121
Use keyword arguments for response functions
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-18 22:08:22 +00:00
Sebastian Crane
77b022455e
Add !list IRC command to dispatch-command function
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-18 22:08:22 +00:00
Sebastian Crane
f891299236
Add response function with tests to list games
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-09 21:46:07 +00:00
Sebastian Crane
083d51a879
Rename !list IRC command to !players
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-09 21:45:03 +00:00
Sebastian Crane
ae06d012ea
Prune empty game if removing its only player
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-09 21:25:20 +00:00
Sebastian Crane
5c0918f990
Add function with tests to dispatch IRC commands
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-09 15:47:24 +00:00
Sebastian Crane
ac1a8d9c94
Make signatures of response functions match
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-09 14:20:06 +00:00
Sebastian Crane
977ab9ea3a
Ensure that add-player-of-game function is idempotent
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-09 14:05:04 +00:00
Sebastian Crane
6e0f0237b3
Add functions with tests for generating responses
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-02-09 14:04:30 +00:00
Sebastian Crane
ec9e3d80eb
Add irclj to dependencies
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-01-03 20:22:40 +00:00
Sebastian Crane
905c6ada4c
Add function with tests to get list of games
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-01-03 14:27:19 +00:00
Sebastian Crane
242873a713
Rename players-of-game function to start with verb
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-01-03 14:25:15 +00:00
Sebastian Crane
f85458340c
Add function with tests to remove game
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-01-01 18:29:19 +00:00
Sebastian Crane
a1e7af5a26
Add test directory to :extra-paths for :test alias
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-01-01 18:27:38 +00:00
Sebastian Crane
e224e02e86
Add function with tests to remove player from game
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-01-01 17:57:47 +00:00
Sebastian Crane
f15c08e2cd
Initial commit
...
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
2022-01-01 17:45:51 +00:00