Update of /cvsroot/gcblue/gcb_wx/src/network
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6798/src/network
Modified Files:
tcMultiplayerInterface.cpp
Log Message:
Index: tcMultiplayerInterface.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** tcMultiplayerInterface.cpp 29 Nov 2006 02:51:44 -0000 1.38
--- tcMultiplayerInterface.cpp 30 Nov 2006 04:11:13 -0000 1.39
***************
*** 2198,2212 ****
tcUpdateStream stream;
tcUpdateMessageHandler::InitializeMessage(tcUpdateMessageHandler::SENSOR_UPDATE, stream);
- tcUpdateMessageHandler::AddSensorUpdateHeader(alliance, stream);
- size_t initialStreamSize = stream.size();
! *allianceSensorMap >> stream;
! if (stream.size() > initialStreamSize)
! {
! SendUpdateMessage(connId, stream);
! fprintf(stdout, ">> sensormap update msg sent, connId (%d) size (%d)\n",
! connId, stream.size());
! }
}
--- 2198,2235 ----
tcUpdateStream stream;
tcUpdateMessageHandler::InitializeMessage(tcUpdateMessageHandler::SENSOR_UPDATE, stream);
+ stream.SetDoneFlag(false);
! unsigned int nMessages = 0;
! const unsigned int maxMessages = 4;
! bool doneWriting = false;
!
! while (!doneWriting && (nMessages++ < maxMessages))
! {
! tcUpdateMessageHandler::AddSensorUpdateHeader(alliance, stream);
! size_t initialStreamSize = stream.size();
!
! *allianceSensorMap >> stream;
! doneWriting = stream.GetDoneFlag();
!
! if (stream.size() > initialStreamSize)
! {
! SendUpdateMessage(connId, stream);
! fprintf(stdout, ">> sensormap update msg sent, connId (%d) size (%d) msg (%d)\n",
! connId, stream.size(), nMessages);
! }
!
! if (!doneWriting)
! {
! stream.clear();
! tcUpdateMessageHandler::InitializeMessage(tcUpdateMessageHandler::SENSOR_UPDATE, stream);
! stream.SetDoneFlag(false);
! }
! }
!
! if (nMessages >= maxMessages)
! {
! fprintf(stderr, "tcMultiplayerInterface::UpdateSensorMap - exceeded max messages\n");
! }
}
|