# HG changeset patch # User unc0rr # Date 1223573302 0 # Node ID 758c39a3dcfee342eed0e15d865d61d790c54a49 # Parent b652c002633bb8008f935820332a0f9bc8b01fc7 Stub to run network game diff -r b652c002633b -r 758c39a3dcfe QTfrontend/newnetclient.cpp --- a/QTfrontend/newnetclient.cpp Thu Oct 09 17:15:04 2008 +0000 +++ b/QTfrontend/newnetclient.cpp Thu Oct 09 17:28:22 2008 +0000 @@ -255,15 +255,15 @@ return; } - if (lst[0] == "REMOVE_TEAM") { - if(lst.size() != 2) - { - qWarning("Net: Bad REMOVETEAM message"); - return; - } - m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1])); - return; - } + if (lst[0] == "REMOVE_TEAM") { + if(lst.size() != 2) + { + qWarning("Net: Bad REMOVETEAM message"); + return; + } + m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1])); + return; + } if(lst[0]=="JOINED") { if(lst.size() < 2) @@ -296,7 +296,7 @@ return; } - if (lst[0] == "RUNGAME") { + if (lst[0] == "RUN_GAME") { RunGame(); return; } diff -r b652c002633b -r 758c39a3dcfe netserver/HWProto.hs --- a/netserver/HWProto.hs Thu Oct 09 17:15:04 2008 +0000 +++ b/netserver/HWProto.hs Thu Oct 09 17:28:22 2008 +0000 @@ -48,6 +48,7 @@ (clientOnly, ["TEAM_COLOR", teamname team, teamcolor team]), (clientOnly, ["HH_NUM", teamname team, show $ hhnum team])] answerMap mapName = [(othersInRoom, ["MAP", mapName])] +answerRunGame = [(sameRoom, ["RUN_GAME"])] -- Main state-independent cmd handler handleCmd :: CmdHandler @@ -211,4 +212,13 @@ findTeam = find (\t -> teamName == teamname t) $ teams clRoom clRoom = roomByName (room client) rooms +handleCmd_inRoom client _ _ ["READY"] = + if not $ isMaster client then + (noChangeClients, noChangeRooms, answerNotMaster) + else + (noChangeClients, noChangeRooms, answerRunGame) + +handleCmd_inRoom client _ _ ["GAMEMSG", msg] = + (noChangeClients, noChangeRooms, [(othersInRoom, ["GAMEMSG", msg])]) + handleCmd_inRoom _ _ _ _ = (noChangeClients, noChangeRooms, answerBadCmd)