Thread: [Gcblue-commits] gcb_wx/src/sim tcAeroAirObject.cpp,1.12,1.13 tcAirObject.cpp,1.19,1.20 tcCommandObj
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-04-17 22:35:41
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14954/src/sim Modified Files: tcAeroAirObject.cpp tcAirObject.cpp tcCommandObject.cpp tcGameObject.cpp tcLauncherState.cpp tcPlatformObject.cpp tcSensorPlatform.cpp tcSubObject.cpp Log Message: fixed problem writing to account database, added command state update as part of create update for new objects at client, removed application-level command ack Index: tcSubObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSubObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcSubObject.cpp 10 Mar 2005 03:28:29 -0000 1.6 --- tcSubObject.cpp 17 Apr 2005 22:35:32 -0000 1.7 *************** *** 97,108 **** } - /** - * - */ - bool tcSubObject::HasUnacknowledgedCommand() const - { - return tcPlatformObject::HasUnacknowledgedCommand() || - commandObj.HasUnacknowledgedCommand(); - } bool tcSubObject::IsDestroyed() --- 97,100 ---- Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcAirObject.cpp 10 Mar 2005 03:28:29 -0000 1.19 --- tcAirObject.cpp 17 Apr 2005 22:35:32 -0000 1.20 *************** *** 89,97 **** } - bool tcAirObject::HasUnacknowledgedCommand() const - { - return tcPlatformObject::HasUnacknowledgedCommand() || - commandObj.HasUnacknowledgedCommand(); - } --- 89,92 ---- Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcLauncherState.cpp 16 Apr 2005 20:44:43 -0000 1.28 --- tcLauncherState.cpp 17 Apr 2005 22:35:32 -0000 1.29 *************** *** 526,537 **** /** - * @return true if at least one launcher has an unacknowledged cmd outstanding - */ - bool tcLauncherState::HasUnacknowledgedCommand() const - { - return (commandObj.HasUnacknowledgedCommand()); - } - - /** * */ --- 526,529 ---- Index: tcSensorPlatform.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorPlatform.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSensorPlatform.cpp 16 Apr 2005 20:44:43 -0000 1.2 --- tcSensorPlatform.cpp 17 Apr 2005 22:35:32 -0000 1.3 *************** *** 321,328 **** } - bool tcSensorPlatform::HasUnacknowledgedCommand() const - { - return sensorCommandObj.HasUnacknowledgedCommand(); - } /** --- 321,324 ---- Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tcPlatformObject.cpp 29 Mar 2005 00:12:29 -0000 1.40 --- tcPlatformObject.cpp 17 Apr 2005 22:35:32 -0000 1.41 *************** *** 656,668 **** unsigned char updateMask = 0; updateMask = UPDATE_GUIDANCE; // always update guidance for now ! if (stream.isAck || mcLauncherState.HasUnacknowledgedCommand()) { updateMask |= UPDATE_LAUNCHERS; } ! if (stream.isAck || tcSensorPlatform::HasUnacknowledgedCommand()) { updateMask |= UPDATE_SENSORS; } stream << updateMask; --- 656,671 ---- unsigned char updateMask = 0; updateMask = UPDATE_GUIDANCE; // always update guidance for now ! ! if (mcLauncherState.HasNewCommand()) { updateMask |= UPDATE_LAUNCHERS; } ! if (tcSensorPlatform::HasNewCommand()) { updateMask |= UPDATE_SENSORS; } + if (stream.GetDetailLevel() == tcStream::WRITE_ALL) updateMask = 0xFF; + stream << updateMask; *************** *** 761,772 **** } - bool tcPlatformObject::HasUnacknowledgedCommand() const - { - return commandObj.HasUnacknowledgedCommand() || mcLauncherState.HasNewCommand() || - tcSensorPlatform::HasUnacknowledgedCommand(); - } - - - --- 764,767 ---- Index: tcAeroAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAeroAirObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcAeroAirObject.cpp 29 Mar 2005 00:12:28 -0000 1.12 --- tcAeroAirObject.cpp 17 Apr 2005 22:35:32 -0000 1.13 *************** *** 32,35 **** --- 32,37 ---- #include "tc3DModel.h" #include "tcParticleEffect.h" + #include "common/tcStream.h" + #include "common/tcObjStream.h" #ifdef _DEBUG *************** *** 40,43 **** --- 42,79 ---- + tcCommandStream& tcAeroAirObject::operator<<(tcCommandStream& stream) + { + tcAirObject::operator<<(stream); + + commandObj.LoadCommandParam(stream, throttleFraction, THROTTLE_CMD); + + return stream; + } + + tcCommandStream& tcAeroAirObject::operator>>(tcCommandStream& stream) + { + tcAirObject::operator>>(stream); + + stream << throttleFraction; + + return stream; + } + + + + + void tcAeroAirObject::ClearNewCommand() + { + tcAirObject::ClearNewCommand(); + commandObj.ClearNewCommand(); + } + + bool tcAeroAirObject::HasNewCommand() const + { + return tcAirObject::HasNewCommand() || commandObj.HasNewCommand(); + } + + + void tcAeroAirObject::Clear() { *************** *** 90,93 **** --- 126,136 ---- } + + void tcAeroAirObject::SetThrottleFraction(float fract) + { + throttleFraction = fract; + commandObj.SetNewCommand(THROTTLE_CMD); + } + void tcAeroAirObject::ApplyRestrictions() { Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcGameObject.cpp 29 Mar 2005 00:12:28 -0000 1.33 --- tcGameObject.cpp 17 Apr 2005 22:35:32 -0000 1.34 *************** *** 473,481 **** } - bool tcGameObject::HasUnacknowledgedCommand() const - { - return false; - } - /** --- 473,476 ---- Index: tcCommandObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCommandObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcCommandObject.cpp 2 Nov 2004 04:23:56 -0000 1.2 --- tcCommandObject.cpp 17 Apr 2005 22:35:32 -0000 1.3 *************** *** 42,55 **** void tcCommandObject::ClearNewCommand() { ! newCommand = false; } bool tcCommandObject::HasNewCommand() const { - return newCommand; - } - - bool tcCommandObject::HasUnacknowledgedCommand() const - { return (commandStatus != 0); } --- 42,50 ---- void tcCommandObject::ClearNewCommand() { ! commandStatus = 0; } bool tcCommandObject::HasNewCommand() const { return (commandStatus != 0); } *************** *** 57,60 **** --- 52,56 ---- + /** * Used with multiplayer client to load a parameter from the server that *************** *** 69,72 **** --- 65,72 ---- stream >> temp; // read into temporary variable + param = temp; // apply update + + /* + if (stream.GetAck()) { *************** *** 89,92 **** --- 89,93 ---- } + */ } *************** *** 99,102 **** --- 100,106 ---- stream >> temp; // read into temporary variable + param = temp; + + /* if (stream.GetAck()) { *************** *** 119,122 **** --- 123,127 ---- } + */ } *************** *** 129,132 **** --- 134,141 ---- temp << stream; // read into temporary obj + param.CopyCommandInfoFrom(temp); // apply update + + /* + if (stream.GetAck()) { *************** *** 149,152 **** --- 158,162 ---- } + */ } *************** *** 159,169 **** { commandStatus |= flag; - newCommand = true; } tcCommandObject::tcCommandObject() ! : commandStatus(0), ! newCommand(0) { } --- 169,177 ---- { commandStatus |= flag; } tcCommandObject::tcCommandObject() ! : commandStatus(0) { } |