- added the ability to remove cell markers

This commit is contained in:
Mark Vejvoda
2012-06-13 16:19:44 +00:00
parent 943dcef9fe
commit 81cc68305c
12 changed files with 375 additions and 12 deletions

View File

@@ -484,6 +484,18 @@ void ClientInterface::updateLobby() {
}
}
break;
case nmtUnMarkCell:
{
NetworkMessageUnMarkCell networkMessageMarkCell;
if(receiveMessage(&networkMessageMarkCell)) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s] got nmtMarkCell\n",__FILE__,__FUNCTION__);
UnMarkedCell msg(networkMessageMarkCell.getTarget(),
networkMessageMarkCell.getFactionIndex());
this->addUnMarkedCell(msg);
}
}
break;
case nmtLaunch:
case nmtBroadCastSetup:
@@ -698,6 +710,19 @@ void ClientInterface::updateFrame(int *checkFrame) {
this->addMarkedCell(msg);
}
}
break;
case nmtUnMarkCell:
{
NetworkMessageUnMarkCell networkMessageMarkCell;
if(receiveMessage(&networkMessageMarkCell)) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s] got nmtMarkCell\n",__FILE__,__FUNCTION__);
UnMarkedCell msg(networkMessageMarkCell.getTarget(),
networkMessageMarkCell.getFactionIndex());
this->addUnMarkedCell(msg);
}
}
break;
case nmtLaunch:
@@ -1200,6 +1225,14 @@ void ClientInterface::sendMarkCellMessage(Vec2i targetPos, int factionIndex, str
sendMessage(&networkMessageMarkCell);
}
void ClientInterface::sendUnMarkCellMessage(Vec2i targetPos, int factionIndex) {
string humanPlayerName = getHumanPlayerName();
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] humanPlayerName = [%s] playerIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,humanPlayerName.c_str(),playerIndex);
NetworkMessageUnMarkCell networkMessageMarkCell(targetPos,factionIndex);
sendMessage(&networkMessageMarkCell);
}
void ClientInterface::sendPingMessage(int32 pingFrequency, int64 pingTime) {
NetworkMessagePing networkMessagePing(pingFrequency,pingTime);
sendMessage(&networkMessagePing);
@@ -1401,6 +1434,18 @@ bool ClientInterface::shouldDiscardNetworkMessage(NetworkMessageType networkMess
}
break;
case nmtUnMarkCell:
{
discard = true;
NetworkMessageUnMarkCell networkMessageMarkCell;
receiveMessage(&networkMessageMarkCell);
UnMarkedCell msg(networkMessageMarkCell.getTarget(),
networkMessageMarkCell.getFactionIndex());
this->addUnMarkedCell(msg);
}
break;
case nmtSynchNetworkGameData:
{
discard = true;