# HG changeset patch # User unc0rr # Date 1236447805 0 # Node ID 36aa0ca6e8aff5a98f18f22517a2d6d08973fb5f # Parent ebc6dfca60d40e400348416a027b36601db32ef0 Cut the length of most used net packet diff -r ebc6dfca60d4 -r 36aa0ca6e8af QTfrontend/newnetclient.cpp --- a/QTfrontend/newnetclient.cpp Sat Mar 07 17:42:54 2009 +0000 +++ b/QTfrontend/newnetclient.cpp Sat Mar 07 17:43:25 2009 +0000 @@ -137,7 +137,7 @@ { QString msg = QString(buf.toBase64()); - RawSendNet(QString("GAMEMSG%1%2").arg(delimeter).arg(msg)); + RawSendNet(QString("EM%1%2").arg(delimeter).arg(msg)); } void HWNewNet::RawSendNet(const QString & str) @@ -543,10 +543,10 @@ return; } - if (lst[0] == "GAMEMSG") { + if (lst[0] == "EM") { if(lst.size() < 2) { - qWarning("Net: Bad GAMEMSG message"); + qWarning("Net: Bad EM message"); return; } for(int i = 1; i < lst.size(); ++i) diff -r ebc6dfca60d4 -r 36aa0ca6e8af gameServer/Actions.hs --- a/gameServer/Actions.hs Sat Mar 07 17:42:54 2009 +0000 +++ b/gameServer/Actions.hs Sat Mar 07 17:43:25 2009 +0000 @@ -28,6 +28,7 @@ | Warning String | ByeClient String | KickClient Int -- clID + | BanClient String -- nick | ModifyClient (ClientInfo -> ClientInfo) | ModifyRoom (RoomInfo -> RoomInfo) | AddRoom String String @@ -232,7 +233,7 @@ adjust (\r -> r{teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r}) rID rooms else do - processAction (clID, serverInfo, clients, rooms) $ AnswerOthersInRoom ["GAMEMSG", rmTeamMsg] + processAction (clID, serverInfo, clients, rooms) $ AnswerOthersInRoom ["EM", rmTeamMsg] return $ adjust (\r -> r{ teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r, diff -r ebc6dfca60d4 -r 36aa0ca6e8af gameServer/HWProtoInRoomState.hs --- a/gameServer/HWProtoInRoomState.hs Sat Mar 07 17:42:54 2009 +0000 +++ b/gameServer/HWProtoInRoomState.hs Sat Mar 07 17:43:25 2009 +0000 @@ -152,9 +152,9 @@ enoughClans = not $ null $ drop 1 $ group $ map teamcolor $ teams room -handleCmd_inRoom _ _ rooms ["GAMEMSG", msg] = +handleCmd_inRoom _ _ rooms ["EM", msg] = [ModifyRoom (\r -> r{roundMsgs = roundMsgs r |> msg}), - AnswerOthersInRoom ["GAMEMSG", msg]] + AnswerOthersInRoom ["EM", msg]] handleCmd_inRoom clID clients rooms ["ROUNDFINISHED"] = diff -r ebc6dfca60d4 -r 36aa0ca6e8af gameServer/HWProtoLobbyState.hs --- a/gameServer/HWProtoLobbyState.hs Sat Mar 07 17:42:54 2009 +0000 +++ b/gameServer/HWProtoLobbyState.hs Sat Mar 07 17:43:25 2009 +0000 @@ -96,7 +96,7 @@ [] else [AnswerThisClient ["RUN_GAME"], - AnswerThisClient $ "GAMEMSG" : toEngineMsg "e$spectate 1" : (Foldable.toList $ roundMsgs jRoom)] + AnswerThisClient $ "EM" : toEngineMsg "e$spectate 1" : (Foldable.toList $ roundMsgs jRoom)] answerTeams = if gameinprogress jRoom then answerAllTeams (teamsAtStart jRoom) @@ -124,8 +124,15 @@ maybeClient = Foldable.find (\cl -> kickNick == nick cl) clients noSuchClient = isNothing maybeClient kickID = clientUID $ fromJust maybeClient - -- room = rooms IntMap.! roomID client - -- roomInfo = if roomID client /= 0 then "room " ++ (name room) else "lobby" + + +handleCmd_lobby clID clients rooms ["BAN", banNick] = + if not $ isAdministrator client then + [] + else + BanClient banNick : handleCmd_lobby clID clients rooms ["KICK", banNick] + where + client = clients IntMap.! clID handleCmd_lobby clID _ _ _ = [ProtocolError "Incorrect command (state: in lobby)"] diff -r ebc6dfca60d4 -r 36aa0ca6e8af share/hedgewars/Data/Graphics/Hedgehog/Invulnerable.png Binary file share/hedgewars/Data/Graphics/Hedgehog/Invulnerable.png has changed