So I added a few commands. One of them is '!do'. It is just a different way of showing text that implies it's meant as roleplaying, rather than just saying it.
More interesting is '/list-users'. It can, surprise surprise, list all users in your place. There is also '/list-users-world' if you prefer longer lists.
As this command needs access to user list, it is implemented inside 'server-handle' instead of the more traditional 'worlds-handle'. I tired to have it in 'worlds-handle', but I couldn't get user list there, because csm does not allow for circular dependencies.
Sad.
It is now automatically issued after '/goto' together with '/look-around'.
You can aso interact with interactibles now. To do so, use the colon syntax like so: ':interactible'. This would be easy if I didn't forget that '() is not considered false in scheme.
It's actually not even a list, but it's own datatype. Weird...
It wasn't really that hard outside of that tho.
I added a bunch of messages at different actions, such as joining a world and such. This required me to allow broadcast to ignore the user it's referring to, as I don't want to be informed about me joining. I think I can figure that out myself.
To do this, I modified 'broadcast-world' like so:
(define (broadcast-world text world #!key (exception '())) (broadcast text (filter (lambda (user) (and (eq? (user-world user) world) (not (eq? user exception)))) user-list)))
This rather wide expression is a function taking optional named argument. There is a few ways to achieve optional arguments in scheme.
The most simple is:
(define (fn a b . c d))
In this example, 'c' and 'd' are optional positional arguments that have the value '() if not given. You can specify default value like so:
(define (fn a b #!optional (b 1) (c 2)))
In case you want to have named arguments instead, you can use '#!key' as mentioned before. It is used like so:
(broadcast-world (user-joined-string user) (user-world user) #:exception user)
I have also added a way to specify the port to listen on. It is specified in the config file under the symbol 'port'. Quite unimaginative, I know.
CHICKEN does occasionally throw warning when you try to compile code that calls function with the wrong number of arguments. Other times, it rather stays silent. In both cases, it still compiles the code, just to crash during runtime.
It should behave like this, as you can change the value of the symbol to a function of different arity at runtime, but it can still be a bit of a pain to debug at times.
I'm getting quite close to finishing. I mainly just want a way for interactives to broadcast as well, but that's about it.
This project is fun, I recommend you to try something similar.