author | unc0rr |
Wed, 30 Apr 2008 20:14:09 +0000 | |
changeset 891 | 701f86df9b4c |
parent 890 | 1d8c4a5ec622 |
child 892 | dfe97199f17e |
permissions | -rw-r--r-- |
890 | 1 |
module HWProto where |
2 |
||
3 |
import IO |
|
4 |
import Miscutils |
|
5 |
||
891
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
6 |
handleCmd :: ClientInfo -> [ClientInfo] -> [RoomInfo] -> [String] -> (Bool, [ClientInfo], [String]) |
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
7 |
|
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
8 |
handleCmd client clients _ ("QUIT":xs) = |
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
9 |
if null (room client) then |
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
10 |
(True, [client], ["QUIT"]) |
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
11 |
else |
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
12 |
(True, clients, ["QUIT " ++ nick client]) |
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
13 |
|
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
14 |
handleCmd client _ _ _ = (False, [client], ["Bad command"]) |