# HG changeset patch # User unc0rr # Date 1223491562 0 # Node ID 4b48ae1f0f53643ad8b49e4c97bf778574f32efd # Parent d166f9069c2bb91f7b0a5c2651cedcdcec96798b Get rid of team id in client code diff -r d166f9069c2b -r 4b48ae1f0f53 QTfrontend/newnetclient.cpp --- a/QTfrontend/newnetclient.cpp Wed Oct 08 18:38:54 2008 +0000 +++ b/QTfrontend/newnetclient.cpp Wed Oct 08 18:46:02 2008 +0000 @@ -107,7 +107,6 @@ void HWNewNet::RemoveTeam(const HWTeam & team) { RawSendNet(QString("REMOVETEAM") + delimeter + team.TeamName); - m_networkToLocalteams.remove(m_networkToLocalteams.key(team.TeamName)); } void HWNewNet::Ready() @@ -307,7 +306,6 @@ qWarning("Net: Bad TEAM_ACCEPTED message"); return; } - m_networkToLocalteams.insert(lst[2].toUInt(), lst[1]); m_pTeamSelWidget->changeTeamStatus(lst[1]); return; } @@ -347,22 +345,16 @@ emit ammoChanged(lst[3], lst[2]); return; } - QStringList hhTmpList=lst[1].split('+'); + 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]); + HWTeam tmptm(hhTmpList[1]); + 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(); + HWTeam tmptm(hhTmpList[1]); + tmptm.numHedgehogs = lst[2].toUInt(); emit hhnumChanged(tmptm); return; } @@ -410,15 +402,17 @@ void HWNewNet::onHedgehogsNumChanged(const HWTeam& team) { - RawSendNet(QString("HHNUM%1%2%1%3%1%4").arg(delimeter).arg(team.TeamName) - .arg(team.getNetID() ? team.getNetID() : m_networkToLocalteams.key(team.TeamName)) + RawSendNet(QString("HHNUM%1%2%1%3") + .arg(delimeter) + .arg(team.TeamName) .arg(team.numHedgehogs)); } void HWNewNet::onTeamColorChanged(const HWTeam& team) { - RawSendNet(QString("CONFIG_PARAM%1TEAM_COLOR+%2+%3%1%4").arg(delimeter).arg(team.TeamName) - .arg(team.getNetID() ? team.getNetID() : m_networkToLocalteams.key(team.TeamName)) + RawSendNet(QString("CONFIG_PARAM%1TEAM_COLOR%1%2%1%3") + .arg(delimeter) + .arg(team.TeamName) .arg(team.teamColor.name())); } diff -r d166f9069c2b -r 4b48ae1f0f53 QTfrontend/newnetclient.h --- a/QTfrontend/newnetclient.h Wed Oct 08 18:38:54 2008 +0000 +++ b/QTfrontend/newnetclient.h Wed Oct 08 18:46:02 2008 +0000 @@ -54,8 +54,6 @@ QString seed; bool m_game_connected; - QMap m_networkToLocalteams; // key is netID, value is local team name - void ConfigAsked(); void RunGame();