# HG changeset patch # User unc0rr # Date 1223481323 0 # Node ID fedaae857a5059c270a14d0455f6597b6128779c # Parent 18da1c5e960db362521ec447a4f1ee62c58a0773 Reformat some code =P diff -r 18da1c5e960d -r fedaae857a50 QTfrontend/newnetclient.cpp --- a/QTfrontend/newnetclient.cpp Wed Oct 08 15:53:23 2008 +0000 +++ b/QTfrontend/newnetclient.cpp Wed Oct 08 15:55:23 2008 +0000 @@ -328,63 +328,63 @@ return; } - if (lst[0] == "CONFIG_PARAM") { - if(lst.size() < 3) - { - qWarning("Net: Bad CONFIG_PARAM message"); - return; - } - if (lst[1] == "SEED") { - emit seedChanged(lst[2]); - return; - } - if (lst[1] == "MAP") { - emit mapChanged(lst[2]); - return; - } - if (lst[1] == "THEME") { - emit themeChanged(lst[2]); - return; - } - if (lst[1] == "HEALTH") { - emit initHealthChanged(lst[2].toUInt()); - return; - } - if (lst[1] == "TURNTIME") { - emit turnTimeChanged(lst[2].toUInt()); - return; - } - if (lst[1] == "FORTSMODE") { - emit fortsModeChanged(lst[2].toInt() != 0); - return; - } - if (lst[1] == "AMMO") { - if(lst.size() < 4) return; - emit ammoChanged(lst[3], lst[2]); - return; + if (lst[0] == "CONFIG_PARAM") { + if(lst.size() < 3) + { + qWarning("Net: Bad CONFIG_PARAM message"); + return; + } + if (lst[1] == "SEED") { + emit seedChanged(lst[2]); + return; + } + if (lst[1] == "MAP") { + emit mapChanged(lst[2]); + return; + } + if (lst[1] == "THEME") { + emit themeChanged(lst[2]); + return; + } + if (lst[1] == "HEALTH") { + emit initHealthChanged(lst[2].toUInt()); + return; + } + if (lst[1] == "TURNTIME") { + emit turnTimeChanged(lst[2].toUInt()); + return; + } + if (lst[1] == "FORTSMODE") { + emit fortsModeChanged(lst[2].toInt() != 0); + return; + } + if (lst[1] == "AMMO") { + if(lst.size() < 4) return; + emit ammoChanged(lst[3], lst[2]); + return; + } + QStringList hhTmpList=lst[1].split('+'); + if (hhTmpList[0] == "TEAM_COLOR") { + HWTeam tmptm(hhTmpList[1], hhTmpList[2].toUInt()); + if(m_networkToLocalteams.find(hhTmpList[2].toUInt())!=m_networkToLocalteams.end()) { + tmptm=HWTeam(hhTmpList[1]); // local team should be changed + } + tmptm.teamColor=QColor(lst[2]); + emit teamColorChanged(tmptm); + return; + } + if (hhTmpList[0] == "HHNUM") { + HWTeam tmptm(hhTmpList[1], hhTmpList[2].toUInt()); + if(m_networkToLocalteams.find(hhTmpList[2].toUInt())!=m_networkToLocalteams.end()) { + tmptm=HWTeam(hhTmpList[1]); // local team should be changed + } + tmptm.numHedgehogs=lst[2].toUInt(); + emit hhnumChanged(tmptm); + return; + } + qWarning() << "Net: Unknown 'CONFIG_PARAM' message:" << lst; + return; } - QStringList hhTmpList=lst[1].split('+'); - if (hhTmpList[0] == "TEAM_COLOR") { - HWTeam tmptm(hhTmpList[1], hhTmpList[2].toUInt()); - if(m_networkToLocalteams.find(hhTmpList[2].toUInt())!=m_networkToLocalteams.end()) { - tmptm=HWTeam(hhTmpList[1]); // local team should be changed - } - tmptm.teamColor=QColor(lst[2]); - emit teamColorChanged(tmptm); - return; - } - if (hhTmpList[0] == "HHNUM") { - HWTeam tmptm(hhTmpList[1], hhTmpList[2].toUInt()); - if(m_networkToLocalteams.find(hhTmpList[2].toUInt())!=m_networkToLocalteams.end()) { - tmptm=HWTeam(hhTmpList[1]); // local team should be changed - } - tmptm.numHedgehogs=lst[2].toUInt(); - emit hhnumChanged(tmptm); - return; - } - qWarning() << "Net: Unknown 'CONFIG_PARAM' message:" << lst; - return; - } // should be kinda game states, which don't allow "GAMEMSG:" at configure step,