Further work on dedicated server
authorunc0rr
Mon, 21 Jul 2008 15:54:12 +0000
changeset 1083 3448dd03483f
parent 1082 596b1dcdc1df
child 1084 61b753296c40
Further work on dedicated server
QTfrontend/newnetclient.cpp
netserver/HWProto.hs
netserver/Miscutils.hs
--- a/QTfrontend/newnetclient.cpp	Mon Jul 21 09:45:40 2008 +0000
+++ b/QTfrontend/newnetclient.cpp	Mon Jul 21 15:54:12 2008 +0000
@@ -125,6 +125,7 @@
   RawSendNet(QString("NICK%1%2").arg(delimeter).arg(mynick));
   RawSendNet(QString("PROTO%1%2").arg(delimeter).arg(*cProtoVer));
   RawSendNet(QString("CREATE%1%2").arg(delimeter).arg("myroom"));
+  RawSendNet(QString("JOIN%1%2").arg(delimeter).arg("myroom"));
 }
 
 void HWNewNet::OnDisconnect()
--- a/netserver/HWProto.hs	Mon Jul 21 09:45:40 2008 +0000
+++ b/netserver/HWProto.hs	Mon Jul 21 15:54:12 2008 +0000
@@ -58,7 +58,7 @@
 	if haveSameRoom then
 		(noChangeClients, noChangeRooms, clientOnly, ["WARNING", "There's already a room with that name"])
 	else
-		(modifyClient client{room = newRoom, isMaster = True}, addRoom (RoomInfo newRoom roomPassword), clientOnly, ["JOINED", nick client])
+		(modifyClient client{room = newRoom, isMaster = True}, addRoom (RoomInfo newRoom roomPassword []), clientOnly, ["JOINED", nick client])
 	where
 		haveSameRoom = not . null $ filter (\room -> newRoom == name room) rooms
 
@@ -85,6 +85,13 @@
 
 handleCmd_inRoom client _ _ ["CHAT_STRING", _, msg] = (noChangeClients, noChangeRooms, othersInRoom, ["CHAT_STRING", nick client, msg])
 
-handleCmd_inRoom client clients rooms ["CONFIG_PARAM", paramName, value] = (noChangeClients, noChangeRooms, othersInRoom, ["CONFIG_PARAM", paramName, value])
+handleCmd_inRoom client clients rooms ["CONFIG_PARAM", paramName, value] =
+	(noChangeClients, noChangeRooms, othersInRoom, ["CONFIG_PARAM", paramName, value])
+
+handleCmd_inRoom client clients rooms ["CONFIG_PARAM", paramName, value1, value2] =
+	(noChangeClients, noChangeRooms, othersInRoom, ["CONFIG_PARAM", paramName, value1, value2])
+
+handleCmd_inRoom client clients rooms ["ADDTEAM:", teamName, teamColor, graveName, fortName, teamLevel, hh0, hh1, hh2, hh3, hh4, hh5, hh6, hh7] =
+	(noChangeClients, noChangeRooms, othersInRoom, ["TEAM_ACCEPTED", "1", teamName])
 
 handleCmd_inRoom _ _ _ _ = (noChangeClients, noChangeRooms, clientOnly, badCmd)
--- a/netserver/Miscutils.hs	Mon Jul 21 09:45:40 2008 +0000
+++ b/netserver/Miscutils.hs	Mon Jul 21 15:54:12 2008 +0000
@@ -22,11 +22,18 @@
 instance Eq ClientInfo where
 	a1 == a2 = handle a1 == handle a2
 
+data TeamInfo =
+	TeamInfo
+	{
+		teamname :: String
+	}
+
 data RoomInfo =
 	RoomInfo
 	{
 		name :: String,
-		password :: String
+		password :: String,
+		teams :: [TeamInfo]
 	}
 
 type ClientsTransform = [ClientInfo] -> [ClientInfo]