Send team removal message to others in room when client disconnects
authorunc0rr
Thu, 09 Oct 2008 16:03:27 +0000
changeset 1334 b58afaadf7ae
parent 1333 b0b0510eb82d
child 1335 c795cbc752c1
Send team removal message to others in room when client disconnects
QTfrontend/pages.cpp
doc/Protocol.odt
netserver/HWProto.hs
--- a/QTfrontend/pages.cpp	Thu Oct 09 15:54:09 2008 +0000
+++ b/QTfrontend/pages.cpp	Thu Oct 09 16:03:27 2008 +0000
@@ -625,6 +625,7 @@
 	QGridLayout * pageLayout = new QGridLayout(this);
 
 	roomName = new QLineEdit(this);
+	roomName->setMaxLength(60);
 	pageLayout->addWidget(roomName, 0, 0);
 	roomsList = new QListWidget(this);
 	pageLayout->addWidget(roomsList, 1, 0, 3, 1);
Binary file doc/Protocol.odt has changed
--- a/netserver/HWProto.hs	Thu Oct 09 15:54:09 2008 +0000
+++ b/netserver/HWProto.hs	Thu Oct 09 16:03:27 2008 +0000
@@ -57,7 +57,10 @@
 	else if isMaster client then
 		(noChangeClients, removeRoom (room client), answerQuit ++ answerAbandoned) -- core disconnects clients on ROOMABANDONED answer
 	else
-		(noChangeClients, noChangeRooms, answerQuit ++ (answerQuitInform $ nick client))
+		(noChangeClients, modifyRoom clRoom{teams = filter (\t -> teamowner t /= nick client) $ teams clRoom}, answerQuit ++ (answerQuitInform $ nick client) ++ answerRemoveClientTeams)
+	where
+		clRoom = roomByName (room client) rooms
+		answerRemoveClientTeams = map (\tn -> (othersInRoom, ["REMOVE_TEAM", teamname tn])) $ filter (\t -> teamowner t == nick client) $ teams clRoom
 
 
 -- check state and call state-dependent commmand handlers