Handbook
Glossary
chat-server
Vocabulary
managed-server
.
chat
Definition
USING:
managed-server
;
IN:
managed-server.chat
TUPLE:
chat-server
<
managed-server
;
Methods
USING:
accessors
managed-server
managed-server.chat
;
M:
chat-server
handle-already-logged-in
username
username-taken-string
send-line
t
client
quit?<<
;
USING:
accessors
combinators.smart
kernel
managed-server
managed-server.chat
sequences
;
M:
chat-server
handle-client-disconnect
[
line-beginning
username
" has quit "
client
object>>
dup
[
"\""
1surround
]
when
]
""
append-outputs-as
send-everyone
;
USING:
combinators.smart
managed-server
managed-server.chat
;
M:
chat-server
handle-client-join
[
line-beginning
username
" has joined"
]
""
append-outputs-as
send-everyone
;
USING:
io
managed-server
managed-server.chat
;
M:
chat-server
handle-login
"Username: "
write
flush
readln
;
USING:
accessors
io
kernel
managed-server
managed-server.chat
sequences
splitting
;
M:
chat-server
handle-managed-client*
readln
dup
f
=
[
t
client
quit?<<
]
when
[
"/"
?head
[
handle-command
]
[
handle-chat
]
if
]
unless-empty
;