You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(140) |
Feb
(98) |
Mar
(152) |
Apr
(104) |
May
(71) |
Jun
(94) |
Jul
(169) |
Aug
(83) |
Sep
(47) |
Oct
(134) |
Nov
(7) |
Dec
(20) |
2004 |
Jan
(41) |
Feb
(14) |
Mar
(42) |
Apr
(47) |
May
(68) |
Jun
(143) |
Jul
(65) |
Aug
(29) |
Sep
(40) |
Oct
(34) |
Nov
(33) |
Dec
(97) |
2005 |
Jan
(29) |
Feb
(30) |
Mar
(9) |
Apr
(37) |
May
(13) |
Jun
(31) |
Jul
(22) |
Aug
(23) |
Sep
|
Oct
(37) |
Nov
(34) |
Dec
(117) |
2006 |
Jan
(48) |
Feb
(6) |
Mar
(2) |
Apr
(71) |
May
(10) |
Jun
(16) |
Jul
(7) |
Aug
(1) |
Sep
(14) |
Oct
(17) |
Nov
(25) |
Dec
(26) |
2007 |
Jan
(8) |
Feb
(2) |
Mar
(7) |
Apr
(26) |
May
|
Jun
(12) |
Jul
(30) |
Aug
(14) |
Sep
(9) |
Oct
(4) |
Nov
(7) |
Dec
(6) |
2008 |
Jan
(10) |
Feb
(10) |
Mar
(6) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(18) |
Aug
(15) |
Sep
(16) |
Oct
(5) |
Nov
(3) |
Dec
(10) |
2009 |
Jan
(11) |
Feb
(2) |
Mar
|
Apr
(15) |
May
(31) |
Jun
(18) |
Jul
(11) |
Aug
(26) |
Sep
(52) |
Oct
(17) |
Nov
(4) |
Dec
|
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@ww...> - 2004-12-06 08:58:17
|
Author: mkrose Date: 2004-12-06 00:58:10 -0800 (Mon, 06 Dec 2004) New Revision: 1353 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/InterfaceRegistry.h trunk/CSP/SimData/Include/SimData/Trace.h trunk/CSP/SimData/SimData/Tests/test_CircularBuffer.cpp trunk/CSP/SimData/Source/Date.cpp Log: Fix a couple minor warnings under msvc. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1353 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-12-05 00:50:46 UTC (rev 1352) +++ trunk/CSP/SimData/CHANGES.current 2004-12-06 08:58:10 UTC (rev 1353) @@ -1,12 +1,15 @@ Version 0.4.0 (in progress) =========================== +2004-12-05: onsight + * Fix a couple minor warnings under msvc. + 2004-12-03: delta - * Updated SimData project files adding a simple project to build + * Updated SimData project files adding a simple project to build Config.cpp. Added a dependency from SimData onto Config and a custom pre-build step. - - * Changed _WIN32 to more vc++ specific protection for + + * Changed _WIN32 to more vc++ specific protection for SIMDATA_STATIC_CONST_DEF(x). 2004-12-02: onsight Modified: trunk/CSP/SimData/Include/SimData/InterfaceRegistry.h =================================================================== --- trunk/CSP/SimData/Include/SimData/InterfaceRegistry.h 2004-12-05 00:50:46 UTC (rev 1352) +++ trunk/CSP/SimData/Include/SimData/InterfaceRegistry.h 2004-12-06 08:58:10 UTC (rev 1353) @@ -615,8 +615,8 @@ } #define __SIMDATA_XML_BASE_SERIALIZE \ - inline void _base_serialize(SIMDATA(Writer) &writer) const { } \ - inline void _base_serialize(SIMDATA(Reader) &reader) { } \ + inline void _base_serialize(SIMDATA(Writer) &) const { } \ + inline void _base_serialize(SIMDATA(Reader) &) { } \ #define __SIMDATA_XML_BASE_SERIALIZE_EXTEND(basename) \ inline void _base_serialize(SIMDATA(Writer) &writer) const { basename::_serialize(writer); } \ Modified: trunk/CSP/SimData/Include/SimData/Trace.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Trace.h 2004-12-05 00:50:46 UTC (rev 1352) +++ trunk/CSP/SimData/Include/SimData/Trace.h 2004-12-06 08:58:10 UTC (rev 1353) @@ -82,7 +82,7 @@ void error(int skip, bool segv=false); - virtual void _backtrace(std::ostream&, int skip) {} + virtual void _backtrace(std::ostream&, int /*skip*/) {} }; Modified: trunk/CSP/SimData/SimData/Tests/test_CircularBuffer.cpp =================================================================== --- trunk/CSP/SimData/SimData/Tests/test_CircularBuffer.cpp 2004-12-05 00:50:46 UTC (rev 1352) +++ trunk/CSP/SimData/SimData/Tests/test_CircularBuffer.cpp 2004-12-06 08:58:10 UTC (rev 1353) @@ -34,7 +34,7 @@ #include <deque> #define TEST_LOOP_COUNT 1000000 -#define DBG false +#define DBG(x) using namespace simdata; @@ -45,9 +45,9 @@ assert(b.getAllocatedSpace() == 0); assert(b.getMaximumAllocation() > 430); for (int i = 0; i < TEST_LOOP_COUNT; ++i) { - if (DBG) std::cerr << "iteration: " << i << "\n"; + DBG(std::cerr << "iteration: " << i << "\n";) uint8 *x = b.getWriteBuffer(1); - *x = i & 255; + *x = static_cast<uint8>(i & 255); b.commitWriteBuffer(); uint32 size; x = b.getReadBuffer(size); @@ -65,12 +65,12 @@ std::deque<uint8*> q_ptr; std::deque<uint32> q_size; for (int i = 0; i < TEST_LOOP_COUNT; ++i) { - if (DBG) std::cerr << "iteration: " << i << "\n"; + DBG(std::cerr << "iteration: " << i << "\n";) if (rand() & 1) { uint32 size; uint8 *x = b.getReadBuffer(size); if (x != 0) { - if (DBG) std::cerr << "read " << (void*)x << " " << size << "\n"; + DBG(std::cerr << "read " << (void*)x << " " << size << "\n";) assert(x == q_ptr.front()); q_ptr.pop_front(); assert(size == q_size.front()); @@ -78,24 +78,23 @@ b.releaseReadBuffer(); } else { assert(q_ptr.empty()); - if (DBG) std::cerr << "read --- empty!\n"; + DBG(std::cerr << "read --- empty!\n";) } } else { uint32 size = (rand() & 255); uint8 *x = b.getWriteBuffer(size); if (x != 0) { - if (DBG) std::cerr << "write " << (void*)x << " " << size << "\n"; + DBG(std::cerr << "write " << (void*)x << " " << size << "\n";) q_ptr.push_back(x); q_size.push_back(size); b.commitWriteBuffer(); } else { - if (DBG) std::cerr << "write --- full! " << q_ptr.size() << "\n"; + DBG(std::cerr << "write --- full! " << q_ptr.size() << "\n";) } } } } - void test() { testRandomUse(); testOneByte(); Modified: trunk/CSP/SimData/Source/Date.cpp =================================================================== --- trunk/CSP/SimData/Source/Date.cpp 2004-12-05 00:50:46 UTC (rev 1352) +++ trunk/CSP/SimData/Source/Date.cpp 2004-12-06 08:58:10 UTC (rev 1353) @@ -97,7 +97,7 @@ year_t years = static_cast<year_t>(nmonths / 12); month_t months = static_cast<month_t>(nmonths % 12); m_month = months + 1; - m_year += years; + m_year += static_cast<year_t>(years); int index = isLeap() ? 1 : 0; if (m_day > days_in_months[index][m_month]) { m_day = days_in_months[index][m_month]; @@ -108,7 +108,7 @@ void Date::subtractMonths(int nmonths) { year_t years = static_cast<year_t>(nmonths / 12); month_t months = static_cast<month_t>(nmonths % 12); - m_year -= years; + m_year -= static_cast<year_t>(years); if (m_month > months) { m_month -= months; } else { @@ -331,11 +331,10 @@ double DateZulu::getMST(radian_t longitude) const { double JD = getJulianDate(); double T = (JD - EPOCH) * SIMDATA_F1p0_36525p0; - double F = DAYSEC * (JD - (int) JD); - double GMST = COEFF0 - DAYSEC/2.0L - + ((COEFF1 + (COEFF2 + COEFF3 * T) * T) * T) + F; + double F = static_cast<double>(DAYSEC * (JD - static_cast<int>(JD))); + double GMST = static_cast<double>(COEFF0 - DAYSEC/2.0L + ((COEFF1 + (COEFF2 + COEFF3 * T) * T) * T) + F); GMST = GMST * SEC2RAD; - int n = (int) (GMST * (0.5/PI)); + int n = static_cast<int>(GMST * (0.5/PI)); if (n < 0) n--; return GMST - n*(2.0*PI) + longitude; } @@ -350,9 +349,10 @@ } double SimDate::update() { + calibrateRealTime(); SimTime dt = 0.0; if (!paused) { - SimTime t = get_realtime(); + SimTime t = getCalibratedRealTime(); dt = t - last_update; last_update = t; setTime(t - reference); |
From: <sv...@ww...> - 2004-12-05 00:50:52
|
Author: delta Date: 2004-12-04 16:50:46 -0800 (Sat, 04 Dec 2004) New Revision: 1352 Modified: trunk/CSP/IndexServer/VisualStudio2003/IndexServer.vcproj Log: * Linked against SimCore(d).lib. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1352 Modified: trunk/CSP/IndexServer/VisualStudio2003/IndexServer.vcproj =================================================================== --- trunk/CSP/IndexServer/VisualStudio2003/IndexServer.vcproj 2004-12-05 00:39:27 UTC (rev 1351) +++ trunk/CSP/IndexServer/VisualStudio2003/IndexServer.vcproj 2004-12-05 00:50:46 UTC (rev 1352) @@ -31,7 +31,7 @@ Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" - AdditionalDependencies="SpatialIndexd.lib SimNetd.lib _cSimDatad.lib ccgnu2.lib SimCore-Newd.lib" + AdditionalDependencies="SpatialIndexd.lib SimNetd.lib _cSimDatad.lib ccgnu2.lib SimCored.lib" OutputFile="../$(ProjectName)d.exe" AdditionalLibraryDirectories="../../SpatialIndex/.bin;../../SimNet/.bin;../../SimData/SimData;../../SimCore/.bin" GenerateDebugInformation="TRUE" @@ -84,7 +84,7 @@ Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" - AdditionalDependencies="ws2_32.lib pthreadVC.lib SpatialIndex.lib SimNet.lib _cSimData.lib ccgnu2.lib SimCore-New.lib" + AdditionalDependencies="ws2_32.lib pthreadVC.lib SpatialIndex.lib SimNet.lib _cSimData.lib ccgnu2.lib SimCore.lib" OutputFile="../$(ProjectName).exe" LinkIncremental="0" AdditionalLibraryDirectories="../../SpatialIndex/.bin;../../SimNet/.bin;../../SimData/SimData;../../SimCore/.bin"/> |
From: <sv...@ww...> - 2004-12-05 00:39:37
|
Author: delta Date: 2004-12-04 16:39:27 -0800 (Sat, 04 Dec 2004) New Revision: 1351 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/GameScreen.h trunk/CSP/CSPSim/Include/glDiagnostics.h trunk/CSP/CSPSim/Source/GameScreen.cpp trunk/CSP/CSPSim/Source/VirtualScene.cpp trunk/CSP/CSPSim/Source/glDiagnostics.cpp trunk/CSP/CSPSim/VisualStudio/CSPSim.sln trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj Log: * Updated CSPSim.vcproj, added SimNet to the build, cleaned up source and header directories and added a custom build step on UpdateObject.net. * Got ride of a few minor warnings. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1351 Diff omitted (18445 bytes). |
From: <sv...@ww...> - 2004-12-05 00:27:12
|
Author: delta Date: 2004-12-04 16:27:06 -0800 (Sat, 04 Dec 2004) New Revision: 1350 Modified: trunk/CSP/SimCore/VisualStudio2003/SimCore.vcproj Log: * Removed Old* and updated. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1350 Modified: trunk/CSP/SimCore/VisualStudio2003/SimCore.vcproj =================================================================== --- trunk/CSP/SimCore/VisualStudio2003/SimCore.vcproj 2004-12-05 00:23:13 UTC (rev 1349) +++ trunk/CSP/SimCore/VisualStudio2003/SimCore.vcproj 2004-12-05 00:27:06 UTC (rev 1350) @@ -28,7 +28,8 @@ Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" - OutputFile="../.bin/$(ProjectName)d.lib"/> + OutputFile="../.bin/$(ProjectName)d.lib" + AdditionalLibraryDirectories=""/> <Tool Name="VCMIDLTool"/> <Tool @@ -100,14 +101,20 @@ Name="Battlefield" Filter=""> <File - RelativePath="..\Battlefield\OldBattlefield.cpp"> + RelativePath="..\Battlefield\Battlefield.cpp"> </File> <File - RelativePath="..\Battlefield\OldSimObject.cpp"> + RelativePath="..\Battlefield\BattlefieldMessages.cpp"> </File> <File + RelativePath="..\Battlefield\LocalBattlefield.cpp"> + </File> + <File RelativePath="..\Battlefield\SceneManager.cpp"> </File> + <File + RelativePath="..\Battlefield\SimObject.cpp"> + </File> </Filter> <Filter Name="Util" @@ -131,14 +138,23 @@ Name="Battlefield" Filter=""> <File - RelativePath="..\Battlefield\OldBattlefield.h"> + RelativePath="..\Battlefield\Battlefield.h"> </File> <File - RelativePath="..\Battlefield\OldSimObject.h"> + RelativePath="..\Battlefield\BattlefieldMessages.h"> </File> <File + RelativePath="..\Battlefield\GlobalBattlefield.h"> + </File> + <File + RelativePath="..\Battlefield\LocalBattlefield.h"> + </File> + <File RelativePath="..\Battlefield\SceneManager.h"> </File> + <File + RelativePath="..\Battlefield\SimObject.h"> + </File> </Filter> <Filter Name="Util" @@ -150,6 +166,9 @@ RelativePath="..\Util\Log.h"> </File> <File + RelativePath="..\Util\MessageTypes.h"> + </File> + <File RelativePath="..\Util\SimpleConfig.h"> </File> <File @@ -158,6 +177,9 @@ <File RelativePath="..\Util\SynchronousUpdate.h"> </File> + <File + RelativePath="..\Util\TimeStamp.h"> + </File> </Filter> </Filter> <Filter @@ -166,7 +188,23 @@ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> </Filter> <File - RelativePath=".\readme.txt"> + RelativePath="..\Battlefield\BattlefieldMessages.net"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="..\..\SimData\Tools\TaggedRecordCompiler\trc.py --header=..\Battlefield\$(InputName).h --source=..\Battlefield\$(InputName).cpp ..\Battlefield\$(InputName).net +" + Outputs="$(InputName).cpp;$(InputName).h"/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="..\..\SimData\Tools\TaggedRecordCompiler\trc.py --header=..\Battlefield\$(InputName).h --source=..\Battlefield\$(InputName).cpp ..\Battlefield\$(InputName).net +" + Outputs="$(InputName).cpp;$(InputName).h"/> + </FileConfiguration> </File> </Files> <Globals> |
From: <sv...@ww...> - 2004-12-05 00:23:20
|
Author: delta Date: 2004-12-04 16:23:13 -0800 (Sat, 04 Dec 2004) New Revision: 1349 Modified: trunk/CSP/SimCore/Util/MessageTypes.h Log: * static_cast Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1349 Modified: trunk/CSP/SimCore/Util/MessageTypes.h =================================================================== --- trunk/CSP/SimCore/Util/MessageTypes.h 2004-12-04 22:22:50 UTC (rev 1348) +++ trunk/CSP/SimCore/Util/MessageTypes.h 2004-12-05 00:23:13 UTC (rev 1349) @@ -71,9 +71,9 @@ inline GlobalPosition const &operator=(simdata::Vector3 const &v) { x0 = static_cast<simdata::uint8>(floor(v.x() / 32000.0) + 128); y0 = static_cast<simdata::uint8>(floor(v.y() / 32000.0) + 128); - x = v.x() - (static_cast<int>(x0)-128) * 32000.0; - y = v.y() - (static_cast<int>(y0)-128) * 32000.0; - z = v.z(); + x = static_cast<float>(v.x() - (static_cast<int>(x0)-128) * 32000.0); + y = static_cast<float>(v.y() - (static_cast<int>(y0)-128) * 32000.0); + z = static_cast<float>(v.z()); return *this; } @@ -119,8 +119,8 @@ } inline Vector2f const &operator=(simdata::Vector3 const &v) { - x = v.x(); - y = v.y(); + x = static_cast<float>(v.x()); + y = static_cast<float>(v.y()); return *this; } @@ -164,9 +164,9 @@ } inline Vector3f const &operator=(simdata::Vector3 const &v) { - x = v.x(); - y = v.y(); - z = v.z(); + x = static_cast<float>(v.x()); + y = static_cast<float>(v.y()); + z = static_cast<float>(v.z()); return *this; } @@ -212,10 +212,10 @@ } inline Vector4f const &operator=(simdata::Quat const &q) { - x = q.x(); - y = q.y(); - z = q.z(); - w = q.w(); + x = static_cast<float>(q.x()); + y = static_cast<float>(q.y()); + z = static_cast<float>(q.z()); + w = static_cast<float>(q.w()); return *this; } |
From: <sv...@ww...> - 2004-12-04 22:23:02
|
Author: mkrose Date: 2004-12-04 14:22:50 -0800 (Sat, 04 Dec 2004) New Revision: 1348 Added: trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/remote.xml trunk/CSP/CSPSim/Include/old/SimNet/ trunk/CSP/CSPSim/Source/Controller.cpp trunk/CSP/CSPSim/Source/ObjectUpdate.net trunk/CSP/CSPSim/Source/old/ClientNode.cpp trunk/CSP/CSPSim/Source/old/EchoServerNode.cpp trunk/CSP/CSPSim/Source/old/RedirectServerNode.cpp trunk/CSP/CSPSim/Source/old/SimNet/ trunk/CSP/CSPSim/Source/old/SimNet/DispatchMessageHandler.cpp trunk/CSP/CSPSim/Source/old/SimNet/EchoMessageHandler.cpp trunk/CSP/CSPSim/Source/old/SimNet/MessageSocketDuplex.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkAddress.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkBroadcaster.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkListener.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkMessage.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkMessenger.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkNode.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkSocket.cpp trunk/CSP/CSPSim/Source/old/SimNet/ObjectUpdateMessage.cpp trunk/CSP/CSPSim/Source/old/SimNet/PrintMessageHandler.cpp trunk/CSP/CSPSim/Source/old/SimNet/RedirectMessageHandler.cpp trunk/CSP/SimCore/Util/MessageTypes.h Removed: trunk/CSP/CSPSim/Include/SimNet/ trunk/CSP/CSPSim/Include/old/SimNet/DispatchMessageHandler.h trunk/CSP/CSPSim/Include/old/SimNet/EchoMessageHandler.h trunk/CSP/CSPSim/Include/old/SimNet/NetworkMessage.h trunk/CSP/CSPSim/Include/old/SimNet/NetworkMessageHandler.h trunk/CSP/CSPSim/Include/old/SimNet/NetworkMessenger.h trunk/CSP/CSPSim/Include/old/SimNet/NetworkNode.h trunk/CSP/CSPSim/Include/old/SimNet/Networking.h trunk/CSP/CSPSim/Include/old/SimNet/Networking.i trunk/CSP/CSPSim/Include/old/SimNet/PrintMessageHandler.h trunk/CSP/CSPSim/Include/old/SimNet/RedirectMessageHandler.h trunk/CSP/CSPSim/Source/ClientNode.cpp trunk/CSP/CSPSim/Source/EchoServerNode.cpp trunk/CSP/CSPSim/Source/RedirectServerNode.cpp trunk/CSP/CSPSim/Source/SimNet/ trunk/CSP/CSPSim/Source/old/SimNet/DispatchMessageHandler.cpp trunk/CSP/CSPSim/Source/old/SimNet/EchoMessageHandler.cpp trunk/CSP/CSPSim/Source/old/SimNet/MessageSocketDuplex.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkAddress.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkBroadcaster.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkListener.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkMessage.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkMessenger.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkNode.cpp trunk/CSP/CSPSim/Source/old/SimNet/NetworkSocket.cpp trunk/CSP/CSPSim/Source/old/SimNet/ObjectUpdateMessage.cpp trunk/CSP/CSPSim/Source/old/SimNet/PrintMessageHandler.cpp trunk/CSP/CSPSim/Source/old/SimNet/RedirectMessageHandler.cpp Modified: trunk/CSP/CSPSim/Bin/CSPSim.py trunk/CSP/CSPSim/Bin/TestObjects.py trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/systems.xml trunk/CSP/CSPSim/Include/CSPSim.h trunk/CSP/CSPSim/Include/CSPSim.i trunk/CSP/CSPSim/Include/Controller.h trunk/CSP/CSPSim/Include/DynamicObject.h trunk/CSP/CSPSim/Include/GameScreen.h trunk/CSP/CSPSim/Include/SystemsModel.h trunk/CSP/CSPSim/Include/Theater/FeatureGroup.h trunk/CSP/CSPSim/Include/Views/CameraAgent.h trunk/CSP/CSPSim/Include/Views/CameraCommand.h trunk/CSP/CSPSim/Include/Views/CameraKinematics.h trunk/CSP/CSPSim/Include/Views/View.h trunk/CSP/CSPSim/SConscript trunk/CSP/CSPSim/Source/CSPSim.cpp trunk/CSP/CSPSim/Source/DynamicObject.cpp trunk/CSP/CSPSim/Source/GameScreen.cpp trunk/CSP/CSPSim/Source/ObjectModel.cpp trunk/CSP/CSPSim/Source/SConscript trunk/CSP/CSPSim/Source/SystemsModel.cpp trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp trunk/CSP/CSPSim/Source/Views/View.cpp trunk/CSP/CSPSim/Source/cCSP.i trunk/CSP/SConstruct trunk/CSP/SimCore/Battlefield/SConscript trunk/CSP/SimCore/Battlefield/SceneManager.cpp Log: * Add in the new distributed battlefield code, replacing the existing simnet code. * Update the view code to reset/reactivate the current view when reselected. A few fixes and enhancements to the padlock view. * Add remote and local controller classes for sending and receiving object update messages, and dead-reckoning intermediate positions. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1348 Diff omitted (192524 bytes). |
From: <sv...@ww...> - 2004-12-03 23:37:45
|
Author: delta Date: 2004-12-03 15:37:39 -0800 (Fri, 03 Dec 2004) New Revision: 1347 Modified: trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/PacketDecoder.h trunk/CSP/SimNet/RecordCodec.cpp Log: * Got ride of a few minor warnings. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1347 Modified: trunk/CSP/SimNet/NetworkInterface.cpp =================================================================== --- trunk/CSP/SimNet/NetworkInterface.cpp 2004-12-03 23:02:01 UTC (rev 1346) +++ trunk/CSP/SimNet/NetworkInterface.cpp 2004-12-03 23:37:39 UTC (rev 1347) @@ -436,7 +436,7 @@ // port number, and routing type will be zero if (source == 0 && m_AllowUnknownPeers && header->routingType() == 0) { simdata::uint32 ip = sender_addr.getAddress().s_addr; - ConnectionPoint point(ip, header->routingData()); + ConnectionPoint point(ip, static_cast<simnet::Port>(header->routingData())); source = getSourceId(point); } Modified: trunk/CSP/SimNet/PacketDecoder.h =================================================================== --- trunk/CSP/SimNet/PacketDecoder.h 2004-12-03 23:02:01 UTC (rev 1346) +++ trunk/CSP/SimNet/PacketDecoder.h 2004-12-03 23:37:39 UTC (rev 1347) @@ -66,7 +66,7 @@ NetworkMessage::Ref msg = m_Codec.decode(header->messageId(), payload, payload_length); if (!msg) return; msg->setSource(header->source()); - msg->setRoutingType(header->routingType()); + msg->setRoutingType(static_cast<simnet::RoutingType>(header->routingType())); msg->setRoutingData(header->routingData()); Callback callback(msg); m_MessageHandlers.apply(callback); Modified: trunk/CSP/SimNet/RecordCodec.cpp =================================================================== --- trunk/CSP/SimNet/RecordCodec.cpp 2004-12-03 23:02:01 UTC (rev 1346) +++ trunk/CSP/SimNet/RecordCodec.cpp 2004-12-03 23:37:39 UTC (rev 1347) @@ -69,7 +69,7 @@ m_Reader.bind(buffer, buffer_length); try { record->serialize(m_TagReader); - } catch (simdata::DataUnderflow const &err) { + } catch (simdata::DataUnderflow const &/*err*/) { SIMNET_LOG(MESSAGE, ERROR, "buffer underflow decoding message"); return 0; } |
From: <sv...@ww...> - 2004-12-03 23:02:07
|
Author: delta Date: 2004-12-03 15:02:01 -0800 (Fri, 03 Dec 2004) New Revision: 1346 Added: trunk/CSP/SimData/Config/ trunk/CSP/SimData/Config/Config.sln trunk/CSP/SimData/Config/Config.vcproj Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Uniform.h trunk/CSP/SimData/Source/Config.cpp trunk/CSP/SimData/VisualStudio2003/SimData.sln trunk/CSP/SimData/VisualStudio2003/SimData.vcproj Log: * Updated SimData project files adding a simple project to build Config.cpp. Added a dependency from SimData onto Config and a custom pre-build step. * Changed _WIN32 to more vc++ specific protection for SIMDATA_STATIC_CONST_DEF(x). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1346 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-12-03 22:37:20 UTC (rev 1345) +++ trunk/CSP/SimData/CHANGES.current 2004-12-03 23:02:01 UTC (rev 1346) @@ -1,6 +1,14 @@ Version 0.4.0 (in progress) =========================== +2004-12-03: delta + * Updated SimData project files adding a simple project to build + Config.cpp. Added a dependency from SimData onto Config and a + custom pre-build step. + + * Changed _WIN32 to more vc++ specific protection for + SIMDATA_STATIC_CONST_DEF(x). + 2004-12-02: onsight * Refactored the Reader and Writer classes, and their subclasses. Most of the logic is now in non-virtual base class methods, with a virtual Added: trunk/CSP/SimData/Config/Config.sln =================================================================== --- trunk/CSP/SimData/Config/Config.sln 2004-12-03 22:37:20 UTC (rev 1345) +++ trunk/CSP/SimData/Config/Config.sln 2004-12-03 23:02:01 UTC (rev 1346) @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Config", "Config.vcproj", "{33DAE914-B7A2-407A-993E-0A12C4A3544B}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {33DAE914-B7A2-407A-993E-0A12C4A3544B}.Debug.ActiveCfg = Debug|Win32 + {33DAE914-B7A2-407A-993E-0A12C4A3544B}.Debug.Build.0 = Debug|Win32 + {33DAE914-B7A2-407A-993E-0A12C4A3544B}.Release.ActiveCfg = Release|Win32 + {33DAE914-B7A2-407A-993E-0A12C4A3544B}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal Added: trunk/CSP/SimData/Config/Config.vcproj =================================================================== --- trunk/CSP/SimData/Config/Config.vcproj 2004-12-03 22:37:20 UTC (rev 1345) +++ trunk/CSP/SimData/Config/Config.vcproj 2004-12-03 23:02:01 UTC (rev 1346) @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.10" + Name="Config" + ProjectGUID="{33DAE914-B7A2-407A-993E-0A12C4A3544B}" + Keyword="MakeFileProj"> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="Debug" + IntermediateDirectory="Debug" + ConfigurationType="1"> + <Tool + Name="VCCLCompilerTool" + RuntimeLibrary="5" + WarningLevel="4"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + OutputFile="../SimData/$(ProjectName)d.exe"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="Release" + IntermediateDirectory="Release" + ConfigurationType="1"> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + GlobalOptimizations="TRUE" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="TRUE" + FavorSizeOrSpeed="1" + EnableFiberSafeOptimizations="TRUE" + OptimizeForProcessor="3" + OptimizeForWindowsApplication="TRUE" + WarningLevel="3"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + OutputFile="../SimData/$(ProjectName).exe"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> + <File + RelativePath="..\Source\Config.cpp"> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Modified: trunk/CSP/SimData/Include/SimData/Uniform.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Uniform.h 2004-12-03 22:37:20 UTC (rev 1345) +++ trunk/CSP/SimData/Include/SimData/Uniform.h 2004-12-03 23:02:01 UTC (rev 1346) @@ -65,7 +65,7 @@ typedef unsigned int uint32; #endif -#ifdef _WIN32 +#if defined(_MSC_VER) && (_MSC_VER >= 1310) # define SIMDATA_STATIC_CONST_DEF(x) # define SIMDATA_PACKED typedef __int64 int64; Modified: trunk/CSP/SimData/Source/Config.cpp =================================================================== --- trunk/CSP/SimData/Source/Config.cpp 2004-12-03 22:37:20 UTC (rev 1345) +++ trunk/CSP/SimData/Source/Config.cpp 2004-12-03 23:02:01 UTC (rev 1346) @@ -24,6 +24,7 @@ */ #include <iostream> +#include <string> int main(int, char **argv) { int x = 1; Modified: trunk/CSP/SimData/VisualStudio2003/SimData.sln =================================================================== --- trunk/CSP/SimData/VisualStudio2003/SimData.sln 2004-12-03 22:37:20 UTC (rev 1345) +++ trunk/CSP/SimData/VisualStudio2003/SimData.sln 2004-12-03 23:02:01 UTC (rev 1346) @@ -1,8 +1,13 @@ Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimData", "SimData.vcproj", "{F9948756-70B5-4328-8A6A-F4BE5A521A27}" ProjectSection(ProjectDependencies) = postProject + {33DAE914-B7A2-407A-993E-0A12C4A3544B} = {33DAE914-B7A2-407A-993E-0A12C4A3544B} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Config", "..\Config\Config.vcproj", "{33DAE914-B7A2-407A-993E-0A12C4A3544B}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -13,6 +18,10 @@ {F9948756-70B5-4328-8A6A-F4BE5A521A27}.Debug.Build.0 = Debug|Win32 {F9948756-70B5-4328-8A6A-F4BE5A521A27}.Release.ActiveCfg = Release|Win32 {F9948756-70B5-4328-8A6A-F4BE5A521A27}.Release.Build.0 = Release|Win32 + {33DAE914-B7A2-407A-993E-0A12C4A3544B}.Debug.ActiveCfg = Debug|Win32 + {33DAE914-B7A2-407A-993E-0A12C4A3544B}.Debug.Build.0 = Debug|Win32 + {33DAE914-B7A2-407A-993E-0A12C4A3544B}.Release.ActiveCfg = Release|Win32 + {33DAE914-B7A2-407A-993E-0A12C4A3544B}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection Modified: trunk/CSP/SimData/VisualStudio2003/SimData.vcproj =================================================================== --- trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-12-03 22:37:20 UTC (rev 1345) +++ trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-12-03 23:02:01 UTC (rev 1346) @@ -78,7 +78,8 @@ CommandLine="copy /Y ..\Source\cSimData.py ..\SimData" ExcludedFromBuild="FALSE"/> <Tool - Name="VCPreBuildEventTool"/> + Name="VCPreBuildEventTool" + CommandLine="..\SimData\Config.exe > ..\Include\SimData\Config.h"/> <Tool Name="VCPreLinkEventTool"/> <Tool @@ -148,7 +149,8 @@ CommandLine="copy /Y ..\Source\cSimData.py ..\SimData" ExcludedFromBuild="FALSE"/> <Tool - Name="VCPreBuildEventTool"/> + Name="VCPreBuildEventTool" + CommandLine="..\SimData\Configd.exe > ..\Include\SimData\Config.h"/> <Tool Name="VCPreLinkEventTool"/> <Tool |
From: <sv...@ww...> - 2004-12-03 22:37:27
|
Author: delta Date: 2004-12-03 14:37:20 -0800 (Fri, 03 Dec 2004) New Revision: 1345 Modified: trunk/CSP/CSPSim/Source/ClientNode.cpp Log: * Commented out simdata::MemoryWriter writer. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1345 Modified: trunk/CSP/CSPSim/Source/ClientNode.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ClientNode.cpp 2004-12-03 09:15:38 UTC (rev 1344) +++ trunk/CSP/CSPSim/Source/ClientNode.cpp 2004-12-03 22:37:20 UTC (rev 1345) @@ -122,7 +122,7 @@ // ptrPayload->timeStamp = timestamp; b_GlobalPosition->value() = simdata::Vector3(timestamp*1.0, timestamp*0.5, 1.0); - simdata::MemoryWriter writer((simdata::uint8 *)ptrPayload); + //simdata::MemoryWriter writer((simdata::uint8 *)ptrPayload); // writer << id; // writer << type; |
From: <sv...@ww...> - 2004-12-03 09:15:47
|
Author: mkrose Date: 2004-12-03 01:15:38 -0800 (Fri, 03 Dec 2004) New Revision: 1344 Modified: trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp Log: Cache outbound object update messages for each detail level. Set the detail level (0-9) based on distance. Objects can use this information to reduce bandwidth by not sending state information that won't be visible on the remote host. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1344 Modified: trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2004-12-03 09:07:55 UTC (rev 1343) +++ trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2004-12-03 09:15:38 UTC (rev 1344) @@ -34,7 +34,9 @@ #include <SimData/DataArchive.h> #include <SimData/DataManager.h> +#include <cmath> + /** Storage class for information about remote players. */ class LocalBattlefield::PlayerInfo: public simdata::Referenced { @@ -100,7 +102,7 @@ void setUpdateProxy(UpdateMaster &master, UpdateProxyConnection::Ref connection); void addPeerUpdate(PeerId id); void removePeerUpdate(PeerId id); - void setUpdateInterval(PeerId id, double interval); + void setUpdateDistance(PeerId id, double distance); }; @@ -122,6 +124,14 @@ bool operator < (PeerUpdateRecord const &other) const { return next_update > other.next_update; } }; + struct PeerUpdateCache { + simnet::NetworkMessage::Ref msg; + simdata::uint32 last_refresh; + }; + + static const int DETAIL_LEVELS = 10; + PeerUpdateCache m_DetailCache[DETAIL_LEVELS]; + // the unit (wrapper) sending updates to remote peers LocalUnitWrapper *m_Wrapper; @@ -145,8 +155,6 @@ UnitUpdateProxy(LocalUnitWrapper *wrapper, UpdateProxyConnection::Ref connection); /** Add a peer to the update list. - * TODO allow the rate and detail level to be set and updated. For now the update - * rate and detail level are fixed at 300 ms and 0, respectively. */ void addPeerUpdate(PeerId id); @@ -163,8 +171,9 @@ * * @param id The id of the peer. * @param interval The interval between updates, in seconds. + * @param detail The level of detail for updates sent to this peer (0-9). */ - void setUpdateInterval(PeerId id, double interval); + void setUpdateParameters(PeerId id, double interval, int detail); }; @@ -241,8 +250,7 @@ current_id = iter->first; float distance = sqrt(iter->second); CSP_LOG(BATTLEFIELD, INFO, "nearest unit owned by " << current_id << " is " << distance << " meters"); - double interval = simdata::clampTo(distance / 10000.0, 0.05, 5.0); - wrapper->setUpdateInterval(current_id, interval); + wrapper->setUpdateDistance(current_id, distance); } } } @@ -680,11 +688,13 @@ double LocalBattlefield::UnitUpdateProxy::onUpdate(double dt) { CSP_LOG(BATTLEFIELD, INFO, "update proxy called"); - const unsigned n = m_PeerUpdates.size(); - if (n == 0) { + + const unsigned n_updates = m_PeerUpdates.size(); + if (n_updates == 0) { CSP_LOG(BATTLEFIELD, WARNING, "no peers to update"); - return 1.0; + return 1.0; // wait 1 sec before checking again } + simdata::uint32 dt_ms = static_cast<simdata::uint32>(dt * 1000.0); m_UpdateTime += dt_ms; // FIXME this can get choppy when the frame rate and update rates are comparable @@ -692,36 +702,69 @@ CSP_LOG(BATTLEFIELD, DEBUG, "too soon, " << (m_UpdateTime - m_PeerUpdates[0].next_update) << " ms"); return (m_UpdateTime - m_PeerUpdates[0].next_update) * 1e-3; } - PeerUpdateRecord targets[128]; + + simcore::TimeStamp timestamp = m_Connection->getTimeStamp(); + + // targets stores (detail, peer id) in an int to facilite sorting + int targets[128]; int target_count = 0; + + // find all peers that need updates now, and generate/cache the update messages + // for each detail level. the updates are kept in a heap, with the next update + // at the top. while ((m_PeerUpdates[0].next_update <= m_UpdateTime) && (target_count < 128)) { std::pop_heap(m_PeerUpdates.begin(), m_PeerUpdates.end()); - m_PeerUpdates[n-1].next_update = m_UpdateTime + m_PeerUpdates[n-1].interval; - targets[target_count++] = m_PeerUpdates[n-1]; + const simdata::uint32 interval = m_PeerUpdates[n_updates - 1].interval; + m_PeerUpdates[n_updates - 1].next_update = m_UpdateTime + interval; + + const int detail = m_PeerUpdates[n_updates - 1].detail; + assert(detail >=0 && detail < DETAIL_LEVELS); + + // ok to use slightly stale messages. note that if we refresh the cache for any + // peer, all other peers at that detail level will get the new message. + if (m_UpdateTime - m_DetailCache[detail].last_refresh > interval / 10) { + // FIXME the state message will be used for multiple peers that are updated at different + // intervals, so the content should not depend on interval. + simnet::NetworkMessage::Ref msg = m_Wrapper->unit()->getState(timestamp, 0 /*interval*/, detail); + msg->setRoutingType(ROUTE_UNIT_UPDATE); + msg->setRoutingData(m_Wrapper->id()); + msg->setPriority(2); // XXX msg/detail dependent? + m_DetailCache[detail].msg = msg; + m_DetailCache[detail].last_refresh = m_UpdateTime; + } + // hack for sorting by detail level, see below + targets[target_count++] = (detail << 24) | m_PeerUpdates[n_updates - 1].id; + std::push_heap(m_PeerUpdates.begin(), m_PeerUpdates.end()); } - // TODO need getState arguments, detail sorting and caching - simcore::TimeStamp timestamp = m_Connection->getTimeStamp(); - simnet::NetworkMessage::Ref msg = m_Wrapper->unit()->getState(timestamp, 0 /*interval*/, 0 /*detail*/); - if (msg.valid()) { - msg->setRoutingType(ROUTE_UNIT_UPDATE); - msg->setRoutingData(m_Wrapper->id()); - msg->setPriority(2); // XXX msg/detail dependent? - for (int i = 0; i < target_count; ++i) { - m_Connection->send(msg, targets[i].id); + + // order by detail level to take advantage of outbound message caching + std::sort(targets, targets + target_count); + + // finally, send all pending updates + for (int i = 0; i < target_count; ++i) { + const int detail = targets[i] >> 24; + const int id = targets[i] & 0xffffff; + simnet::NetworkMessage::Ref msg = m_DetailCache[detail].msg; + if (msg.valid()) { + m_Connection->send(msg, id); + } else { + CSP_LOG(BATTLEFIELD, ERROR, "no state message"); } - } else { - CSP_LOG(BATTLEFIELD, ERROR, "no state message"); } + + // we don't need to be called again until the next update time is reached return (m_PeerUpdates[0].next_update - m_UpdateTime) * 1e-3; } -void LocalBattlefield::UnitUpdateProxy::setUpdateInterval(PeerId id, double interval) { +void LocalBattlefield::UnitUpdateProxy::setUpdateParameters(PeerId id, double interval, int detail) { + assert(detail >= 0 && detail < DETAIL_LEVELS); simdata::uint16 interval_ms = static_cast<simdata::uint16>(interval * 1000.0); const unsigned n = m_PeerUpdates.size(); for (unsigned i = 0; i < n; ++i) { if (m_PeerUpdates[i].id == id) { m_PeerUpdates[i].interval = interval_ms; + m_PeerUpdates[i].detail = detail; CSP_LOG(BATTLEFIELD, INFO, "set update interval for peer " << id << " to " << interval_ms << " ms"); return; } @@ -753,9 +796,22 @@ m_UpdateProxy->removePeerUpdate(id); } -void LocalBattlefield::LocalUnitWrapper::setUpdateInterval(PeerId id, double interval) { +void LocalBattlefield::LocalUnitWrapper::setUpdateDistance(PeerId id, double distance) { assert(m_UpdateProxy.valid()); - m_UpdateProxy->setUpdateInterval(id, interval); + double interval = simdata::clampTo(distance / 10000.0, 0.05, 5.0); + // detail levels: + // 9 = 0-50 m + // 8 = 50-100 m + // 7 = 100-200 m + // 6 = 200-400 m + // 5 = 400-800 m + // 4 = 800-1600 m + // 3 = 1.6-3.2 km + // 2 = 3.2-6.4 km + // 1 = 6.4-12.8 km + // 0 = >12.8 km + int detail = std::max(0, 9 - static_cast<int>(1.4427 * log(std::max(1.0, distance / 25.0)))); + m_UpdateProxy->setUpdateParameters(id, interval, detail); } LocalBattlefield::LocalUnitWrapper* LocalBattlefield::findLocalUnitWrapper(ObjectId id) { |
From: <sv...@ww...> - 2004-12-03 09:08:01
|
Author: mkrose Date: 2004-12-03 01:07:55 -0800 (Fri, 03 Dec 2004) New Revision: 1343 Modified: trunk/CSP/SimNet/MessageQueue.h trunk/CSP/SimNet/NetBase.h trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/PacketDecoder.h trunk/CSP/SimNet/PeerInfo.cpp trunk/CSP/SimNet/RecordCodec.cpp trunk/CSP/SimNet/RoutingHandler.cpp Log: Make NetworkMessage header endian-independent. The message bodies are now also endian-independent (see the latest SimData change). Remove the last bitfield from the message header. Fix a compile error introduced by the last SimData change. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1343 Diff omitted (17614 bytes). |
From: <sv...@ww...> - 2004-12-03 09:02:09
|
Author: mkrose Date: 2004-12-03 01:02:03 -0800 (Fri, 03 Dec 2004) New Revision: 1342 Modified: trunk/CSP/SimData/Source/DataArchive.cpp Log: Oops, forgot an include statement in the last checkin. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1342 Modified: trunk/CSP/SimData/Source/DataArchive.cpp =================================================================== --- trunk/CSP/SimData/Source/DataArchive.cpp 2004-12-03 08:54:56 UTC (rev 1341) +++ trunk/CSP/SimData/Source/DataArchive.cpp 2004-12-03 09:02:03 UTC (rev 1342) @@ -21,8 +21,9 @@ #include <SimData/DataArchive.h> #include <SimData/DataManager.h> #include <SimData/InterfaceRegistry.h> +#include <SimData/Log.h> #include <SimData/Object.h> -#include <SimData/Log.h> +#include <SimData/Verify.h> #include <iomanip> #include <iostream> |
From: <sv...@ww...> - 2004-12-03 08:55:09
|
Author: mkrose Date: 2004-12-03 00:54:56 -0800 (Fri, 03 Dec 2004) New Revision: 1341 Added: trunk/CSP/SimData/Include/SimData/Endian.h trunk/CSP/SimData/Source/Config.cpp Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Archive.h trunk/CSP/SimData/Include/SimData/TaggedRecord.h trunk/CSP/SimData/Include/SimData/Uniform.h trunk/CSP/SimData/SimData/Tests/ArchiveTests.py trunk/CSP/SimData/Source/DataArchive.cpp trunk/CSP/SimData/Source/SConscript trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc_lex.py Log: * Refactored the Reader and Writer classes, and their subclasses. Most of the logic is now in non-virtual base class methods, with a virtual interface for reading/writing raw byte strings implemented by the subclass. Also added support for serializing int64 and uint64, and made length codes variable-width. * Added a configuration program to generate a header file with machine and compiler specific definitions. => WINDOWS users need to set up a custom build rule to first build Source/Config.cpp as a standalone binary, and then run it to generate Include/SimData/Config.h. This header must be created before the rest of SimData is built. Note that the Config binary writes the header text to stdout, so that must be redirected to the appropriate file path. * Added an endian conversion header based on GLib. Converted the Reader and Writer classes to be endian independent (all values are stored as little-endian, regardless of the machine architecture). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1341 Diff omitted (59021 bytes). |
From: <sv...@ww...> - 2004-12-02 20:21:10
|
Author: delta Date: 2004-12-02 12:20:57 -0800 (Thu, 02 Dec 2004) New Revision: 1340 Added: trunk/CSP/SimCore/SimCore-New/ trunk/CSP/SimCore/SimCore-New/SimCore-New.sln trunk/CSP/SimCore/SimCore-New/SimCore-New.vcproj trunk/CSP/SimCore/VisualStudio2003/TestClient/ trunk/CSP/SimCore/VisualStudio2003/TestClient/TestClient.sln trunk/CSP/SimCore/VisualStudio2003/TestClient/TestClient.vcproj Log: * Added temporary SimCore-New vs 2003 project files. * Added TestClient vs 2003 project files. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1340 Diff omitted (11855 bytes). |
From: <sv...@ww...> - 2004-12-02 19:55:01
|
Author: delta Date: 2004-12-02 11:54:55 -0800 (Thu, 02 Dec 2004) New Revision: 1339 Modified: trunk/CSP/SimCore/VisualStudio2003/SimCore.vcproj Log: * Update with Old files & small setup changes. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1339 Modified: trunk/CSP/SimCore/VisualStudio2003/SimCore.vcproj =================================================================== --- trunk/CSP/SimCore/VisualStudio2003/SimCore.vcproj 2004-12-02 19:53:36 UTC (rev 1338) +++ trunk/CSP/SimCore/VisualStudio2003/SimCore.vcproj 2004-12-02 19:54:55 UTC (rev 1339) @@ -22,7 +22,8 @@ PreprocessorDefinitions="WIN32" RuntimeLibrary="3" RuntimeTypeInfo="TRUE" - WarningLevel="4"/> + WarningLevel="4" + DisableSpecificWarnings="4511;4512"/> <Tool Name="VCCustomBuildTool"/> <Tool @@ -102,10 +103,10 @@ RelativePath="..\Battlefield\OldBattlefield.cpp"> </File> <File - RelativePath="..\Battlefield\SceneManager.cpp"> + RelativePath="..\Battlefield\OldSimObject.cpp"> </File> <File - RelativePath="..\Battlefield\OldSimObject.cpp"> + RelativePath="..\Battlefield\SceneManager.cpp"> </File> </Filter> <Filter @@ -133,10 +134,10 @@ RelativePath="..\Battlefield\OldBattlefield.h"> </File> <File - RelativePath="..\Battlefield\SceneManager.h"> + RelativePath="..\Battlefield\OldSimObject.h"> </File> <File - RelativePath="..\Battlefield\OldSimObject.h"> + RelativePath="..\Battlefield\SceneManager.h"> </File> </Filter> <Filter |
From: <sv...@ww...> - 2004-12-02 19:53:42
|
Author: delta Date: 2004-12-02 11:53:36 -0800 (Thu, 02 Dec 2004) New Revision: 1338 Modified: trunk/CSP/SimCore/Battlefield/Battlefield.cpp trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp trunk/CSP/SimCore/Battlefield/test-client.cpp Log: * Small changes in loops syntax. * Changed round to floor in LocalBattlefield.cpp & got ride of a few warnings in this file. * Eliminated a few cast warnings. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1338 Modified: trunk/CSP/SimCore/Battlefield/Battlefield.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/Battlefield.cpp 2004-12-02 19:18:43 UTC (rev 1337) +++ trunk/CSP/SimCore/Battlefield/Battlefield.cpp 2004-12-02 19:53:36 UTC (rev 1338) @@ -30,7 +30,7 @@ Battlefield::Unit Battlefield::getNextUnit(Unit const &unit, int human, int local, int /*category*/) { UnitMap::iterator iter = m_UnitMap.find(unit->id()); if (iter != m_UnitMap.end()) { - for (UnitMap::iterator scan = iter; 1; ) { + for (UnitMap::iterator scan = iter; ; ) { if (++scan == m_UnitMap.end()) scan = m_UnitMap.begin(); if (scan == iter) break; Unit u = scan->second->unit(); Modified: trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h =================================================================== --- trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h 2004-12-02 19:18:43 UTC (rev 1337) +++ trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h 2004-12-02 19:53:36 UTC (rev 1338) @@ -401,7 +401,7 @@ CommandAddUnit::Ref msg = new CommandAddUnit(); msg->set_unit_id(from->id()); msg->set_unit_class(simdata::Path(from->unit()->getObjectPath())); - msg->set_unit_type(from->unit()->type()); + msg->set_unit_type(static_cast<const simdata::uint8>(from->unit()->type())); msg->set_owner_id(from->owner()); msg->set_grid_x(from->point().x()); msg->set_grid_y(from->point().y()); Modified: trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2004-12-02 19:18:43 UTC (rev 1337) +++ trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2004-12-02 19:53:36 UTC (rev 1338) @@ -22,7 +22,6 @@ * **/ - #include <SimCore/Battlefield/LocalBattlefield.h> #include <SimCore/Battlefield/Battlefield.h> #include <SimCore/Battlefield/SceneManager.h> @@ -255,7 +254,8 @@ void LocalBattlefield::continueUnitScan(double dt) { static const double loop_time = 3.0; // seconds m_ScanElapsedTime += dt; - unsigned target_index = static_cast<unsigned>(round(m_ScanElapsedTime * m_ScanRate)); + //XXX + unsigned target_index = static_cast<unsigned>(floor(m_ScanElapsedTime * m_ScanRate + 0.5)); if (m_ScanIndex > target_index) return; if (m_ScanIndex == m_ScanUnits.size()) { if (m_ScanElapsedTime < loop_time) return; @@ -475,7 +475,7 @@ Unit unit; try { unit = m_DataManager->getObject(wrapper->path()); - } catch (simdata::IndexError const &err) { + } catch (simdata::IndexError const &) { // pass (error handled below) } if (!unit) { @@ -531,7 +531,7 @@ RegisterUnit::Ref msg = new RegisterUnit(); msg->set_unit_id(unit->id()); msg->set_unit_class(unit->getObjectPath()); - msg->set_unit_type(unit->type()); + msg->set_unit_type(static_cast<const simdata::uint8>(unit->type())); msg->set_grid_x(wrapper->point().x()); msg->set_grid_y(wrapper->point().y()); sendServerCommand(msg); Modified: trunk/CSP/SimCore/Battlefield/test-client.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/test-client.cpp 2004-12-02 19:18:43 UTC (rev 1337) +++ trunk/CSP/SimCore/Battlefield/test-client.cpp 2004-12-02 19:53:36 UTC (rev 1338) @@ -117,7 +117,7 @@ simdata::Timer timer; timer.start(); bool added = false; - while (1) { + for (;;) { client->processAndWait(0.01, 0.01, 0.1); bf->update(timer.elapsed()); timer.reset(); |
From: <sv...@ww...> - 2004-12-02 19:18:49
|
Author: delta Date: 2004-12-02 11:18:43 -0800 (Thu, 02 Dec 2004) New Revision: 1337 Added: trunk/CSP/IndexServer/VisualStudio2003/ trunk/CSP/IndexServer/VisualStudio2003/IndexServer.sln trunk/CSP/IndexServer/VisualStudio2003/IndexServer.vcproj Modified: trunk/CSP/IndexServer/IndexServer.cpp Log: * 'interface' is a key word for vc++. * Added VS2003 directory & initial project files (linked against SimCore-New). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1337 Modified: trunk/CSP/IndexServer/IndexServer.cpp =================================================================== --- trunk/CSP/IndexServer/IndexServer.cpp 2004-12-02 18:18:12 UTC (rev 1336) +++ trunk/CSP/IndexServer/IndexServer.cpp 2004-12-02 19:18:43 UTC (rev 1337) @@ -42,16 +42,16 @@ void IndexServer::initPrimaryInterface() { assert(m_NetworkServer.isNull()); - const std::string interface = g_Config.getString("Network", "Bind", "127.0.0.1:4999", true); - const std::string::size_type colon = interface.find(':'); + const std::string server_interface = g_Config.getString("Network", "Bind", "127.0.0.1:4999", true); + const std::string::size_type colon = server_interface.find(':'); std::string address; simnet::Port port = 0; if (colon != std::string::npos) { - port = atoi(interface.substr(colon + 1).c_str()); - address = interface.substr(0, colon); + port = static_cast<simnet::Port>(atoi(server_interface.substr(colon + 1).c_str())); + address = server_interface.substr(0, colon); } if (address.size() == 0 || port == 0) { - std::cerr << "Invalid value for Network.Bind in .ini file: " << interface << "\n"; + std::cerr << "Invalid value for Network.Bind in .ini file: " << server_interface << "\n"; std::cerr << "Should be of the form www.xxx.yyy.zzz:port\n"; ::exit(1); } @@ -71,7 +71,7 @@ CSP_LOG(APP, INFO, "starting network loop"); simdata::Timer timer; timer.start(); - while (1) { + for (;;) { m_NetworkServer->processAndWait(0.01, 0.01, 0.10); m_Battlefield->update(timer.incremental()); } @@ -94,3 +94,4 @@ IndexServer server; server.run(); } + Added: trunk/CSP/IndexServer/VisualStudio2003/IndexServer.sln =================================================================== --- trunk/CSP/IndexServer/VisualStudio2003/IndexServer.sln 2004-12-02 18:18:12 UTC (rev 1336) +++ trunk/CSP/IndexServer/VisualStudio2003/IndexServer.sln 2004-12-02 19:18:43 UTC (rev 1337) @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IndexServer", "IndexServer.vcproj", "{B2F61A0D-4653-4E7E-ACA2-5767B2F65E32}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {B2F61A0D-4653-4E7E-ACA2-5767B2F65E32}.Debug.ActiveCfg = Debug|Win32 + {B2F61A0D-4653-4E7E-ACA2-5767B2F65E32}.Debug.Build.0 = Debug|Win32 + {B2F61A0D-4653-4E7E-ACA2-5767B2F65E32}.Release.ActiveCfg = Release|Win32 + {B2F61A0D-4653-4E7E-ACA2-5767B2F65E32}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal Added: trunk/CSP/IndexServer/VisualStudio2003/IndexServer.vcproj =================================================================== --- trunk/CSP/IndexServer/VisualStudio2003/IndexServer.vcproj 2004-12-02 18:18:12 UTC (rev 1336) +++ trunk/CSP/IndexServer/VisualStudio2003/IndexServer.vcproj 2004-12-02 19:18:43 UTC (rev 1337) @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.10" + Name="IndexServer" + ProjectGUID="{B2F61A0D-4653-4E7E-ACA2-5767B2F65E32}" + Keyword="MakeFileProj"> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="Debug" + IntermediateDirectory="Debug" + ConfigurationType="1"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="../../SimData/Include;../.." + RuntimeLibrary="3" + RuntimeTypeInfo="TRUE" + ExpandAttributedSource="TRUE" + BrowseInformation="1" + WarningLevel="4" + Detect64BitPortabilityProblems="FALSE" + DebugInformationFormat="3" + DisableSpecificWarnings="4511;4512;4100"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="SpatialIndexd.lib SimNetd.lib _cSimDatad.lib ccgnu2.lib SimCore-Newd.lib" + OutputFile="../$(ProjectName)d.exe" + AdditionalLibraryDirectories="../../SpatialIndex/.bin;../../SimNet/.bin;../../SimData/SimData;../../SimCore/.bin" + GenerateDebugInformation="TRUE" + AssemblyDebug="1" + GenerateMapFile="TRUE" + MapExports="FALSE" + MapLines="FALSE"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="Release" + IntermediateDirectory="Release" + ConfigurationType="1"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + GlobalOptimizations="FALSE" + InlineFunctionExpansion="0" + EnableIntrinsicFunctions="FALSE" + FavorSizeOrSpeed="0" + OptimizeForProcessor="0" + OptimizeForWindowsApplication="FALSE" + AdditionalIncludeDirectories="../../SimData/Include;../.." + RuntimeLibrary="2" + EnableEnhancedInstructionSet="0" + RuntimeTypeInfo="TRUE" + WarningLevel="3" + DebugInformationFormat="0"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="ws2_32.lib pthreadVC.lib SpatialIndex.lib SimNet.lib _cSimData.lib ccgnu2.lib SimCore-New.lib" + OutputFile="../$(ProjectName).exe" + LinkIncremental="0" + AdditionalLibraryDirectories="../../SpatialIndex/.bin;../../SimNet/.bin;../../SimData/SimData;../../SimCore/.bin"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> + <File + RelativePath="..\Config.cpp"> + </File> + <File + RelativePath="..\IndexServer.cpp"> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> + <File + RelativePath="..\Config.h"> + </File> + <File + RelativePath="..\IndexServer.h"> + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> |
From: <sv...@ww...> - 2004-12-02 18:18:19
|
Author: delta Date: 2004-12-02 10:18:12 -0800 (Thu, 02 Dec 2004) New Revision: 1336 Modified: trunk/CSP/SimNet/MessageQueue.h trunk/CSP/SimNet/NetBase.h trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/PeerInfo.cpp trunk/CSP/SimNet/RecordCodec.cpp trunk/CSP/SimNet/RoutingHandler.cpp trunk/CSP/SimNet/VisualStudio2003/SimNet.vcproj Log: * Cleaned up the custom build step and other setup. * Got ride of a few cast warnings. * Removed redondant (for vc++) declaration of a few const statics in source files. * Changed the syntax of a few tautological loops. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1336 Modified: trunk/CSP/SimNet/MessageQueue.h =================================================================== --- trunk/CSP/SimNet/MessageQueue.h 2004-12-02 18:02:11 UTC (rev 1335) +++ trunk/CSP/SimNet/MessageQueue.h 2004-12-02 18:18:12 UTC (rev 1336) @@ -115,7 +115,7 @@ m_Queue.pop_front(); SIMNET_LOG(MESSAGE, ALERT, "SENDING MESSAGE " << message->getCustomId() << " " << message->getName()); header->destination = destination; - header->message_id = message->getCustomId(); + header->message_id = static_cast<simdata::uint16>(message->getCustomId()); header->routing_type = message->getRoutingType(); header->routing_data = message->getRoutingData(); Modified: trunk/CSP/SimNet/NetBase.h =================================================================== --- trunk/CSP/SimNet/NetBase.h 2004-12-02 18:02:11 UTC (rev 1335) +++ trunk/CSP/SimNet/NetBase.h 2004-12-02 18:18:12 UTC (rev 1336) @@ -99,13 +99,13 @@ if (reliable) flags |= 1; else flags &= ~1; } inline void setPriority(int priority) { - flags = (flags & ~0x06) | ((priority & 3) << 1); + flags = static_cast<simdata::uint16>((flags & ~0x06) | ((priority & 3) << 1)); } inline void setStatMode(int statmode) { - flags = (flags & ~0x20) | ((statmode & 1) << 5); + flags = static_cast<simdata::uint16>((flags & ~0x20) | ((statmode & 1) << 5)); } inline void setConnStat(int connstat) { - flags = (flags & 0x3f) | (connstat << 6); + flags = static_cast<simdata::uint16>((flags & 0x3f) | (connstat << 6)); } }; Modified: trunk/CSP/SimNet/NetworkInterface.cpp =================================================================== --- trunk/CSP/SimNet/NetworkInterface.cpp 2004-12-02 18:02:11 UTC (rev 1335) +++ trunk/CSP/SimNet/NetworkInterface.cpp 2004-12-02 18:18:12 UTC (rev 1336) @@ -76,13 +76,7 @@ const simdata::uint32 NetworkInterface::HeaderSize = sizeof(PacketHeader); const simdata::uint32 NetworkInterface::ReceiptHeaderSize = sizeof(PacketReceiptHeader); -const simdata::uint16 NetworkInterface::PingID; -const simdata::uint32 NetworkInterface::PeerIndexSize; -const simdata::uint32 NetworkInterface::MaxPayloadLength; -const PeerId NetworkInterface::InitialClientId; -const PeerId NetworkInterface::ServerId; - /** Callback for HandlerSet<PacketHandler>::apply, to call the handlePacket * method of each of the handlers in the set. */ @@ -125,7 +119,7 @@ StopWatch watch(timeout, swd); watch.start(); - while (true) { + for (;;) { // TODO abstract the scheduling strategy if (queue->isEmpty() || count <= 0) { @@ -401,7 +395,7 @@ StopWatch watch(timeout, swd); watch.start(); - while (true) { + for(;;) { if (!m_Socket->isPendingReceive(0)) { watch.calibrate(); @@ -571,7 +565,7 @@ int DEBUG_exitcode = 0; - while (true) { + for (;;) { // TODO abstract the scheduling strategy if (queue->isEmpty() || count <= 0) { @@ -782,7 +776,7 @@ // use LastAssignedPeerId to rotate through assignments, rather than always // reassigning low ids. greatly increases the average time to recycle an id. assert(m_LastAssignedPeerId > 1); - for (PeerId id = m_LastAssignedPeerId + 1; true; ++id) { + for (PeerId id = m_LastAssignedPeerId + 1; ; ++id) { if (id == PeerIndexSize) id = 2; if (!m_PeerIndex[id].isActive()) { if (m_PeerIndex[id].getLastDeactivationTime() < cutoff) { Modified: trunk/CSP/SimNet/PeerInfo.cpp =================================================================== --- trunk/CSP/SimNet/PeerInfo.cpp 2004-12-02 18:02:11 UTC (rev 1335) +++ trunk/CSP/SimNet/PeerInfo.cpp 2004-12-02 18:18:12 UTC (rev 1336) @@ -39,10 +39,6 @@ return x * (1.0 - f) + y * f; } - -const simdata::uint32 PeerInfo::UDP_OVERHEAD; - - static int DEBUG_connection_display_loop = 0; PeerInfo::PeerInfo(): @@ -275,7 +271,7 @@ peer->update(m_ElapsedTime, scale_desired_peer_to_self); desired_rate_to_self += peer->getDesiredRatePeerToSelf(); if (peer->needsPing()) ni->pingPeer(peer); - while (true) { + for(;;) { ReliablePacket::Ref packet = peer->getNextResend(now); if (!packet) break; ni->resend(packet); Modified: trunk/CSP/SimNet/RecordCodec.cpp =================================================================== --- trunk/CSP/SimNet/RecordCodec.cpp 2004-12-02 18:02:11 UTC (rev 1335) +++ trunk/CSP/SimNet/RecordCodec.cpp 2004-12-02 18:18:12 UTC (rev 1336) @@ -102,8 +102,5 @@ return true; } -const int RecordCodec::MAX_MESSAGE_IDS; - - } // namespace simnet Modified: trunk/CSP/SimNet/RoutingHandler.cpp =================================================================== --- trunk/CSP/SimNet/RoutingHandler.cpp 2004-12-02 18:02:11 UTC (rev 1335) +++ trunk/CSP/SimNet/RoutingHandler.cpp 2004-12-02 18:18:12 UTC (rev 1336) @@ -31,9 +31,6 @@ namespace simnet { - -const unsigned RoutingHandler::RoutingTableSize; - RoutingHandler::RoutingHandler() { } Modified: trunk/CSP/SimNet/VisualStudio2003/SimNet.vcproj =================================================================== --- trunk/CSP/SimNet/VisualStudio2003/SimNet.vcproj 2004-12-02 18:02:11 UTC (rev 1335) +++ trunk/CSP/SimNet/VisualStudio2003/SimNet.vcproj 2004-12-02 18:18:12 UTC (rev 1336) @@ -25,7 +25,7 @@ RuntimeTypeInfo="TRUE" WarningLevel="4" DebugInformationFormat="3" - DisableSpecificWarnings="4275;4100;4512;4511"/> + DisableSpecificWarnings="4511;4512;4100"/> <Tool Name="VCCustomBuildTool"/> <Tool @@ -67,8 +67,7 @@ PreprocessorDefinitions="WIN32" RuntimeLibrary="2" RuntimeTypeInfo="TRUE" - WarningLevel="3" - DisableSpecificWarnings="4275"/> + WarningLevel="3"/> <Tool Name="VCCustomBuildTool"/> <Tool @@ -146,6 +145,9 @@ RelativePath="..\ClientServer.h"> </File> <File + RelativePath="..\ClientServerMessages.h"> + </File> + <File RelativePath="..\DispatchCache.h"> </File> <File @@ -231,7 +233,7 @@ Name="VCCustomBuildTool" CommandLine="..\..\SimData\Tools\TaggedRecordCompiler\trc.py --header=..\$(InputName).h --source=..\$(InputName).cpp ..\$(InputName).net " - Outputs="$(InputName).h $(InputName).cpp"/> + Outputs="../$(InputName).h;../$(InputName).cpp"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> |
From: <sv...@ww...> - 2004-12-02 18:02:17
|
Author: delta Date: 2004-12-02 10:02:11 -0800 (Thu, 02 Dec 2004) New Revision: 1335 Modified: trunk/CSP/SpatialIndex/VisualStudio/SpatialIndex.vcproj Log: * Increased the level of warnings and optimized the release build. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1335 Modified: trunk/CSP/SpatialIndex/VisualStudio/SpatialIndex.vcproj =================================================================== --- trunk/CSP/SpatialIndex/VisualStudio/SpatialIndex.vcproj 2004-12-02 17:56:42 UTC (rev 1334) +++ trunk/CSP/SpatialIndex/VisualStudio/SpatialIndex.vcproj 2004-12-02 18:02:11 UTC (rev 1335) @@ -57,14 +57,21 @@ ConfigurationType="4"> <Tool Name="VCCLCompilerTool" + Optimization="3" GlobalOptimizations="TRUE" InlineFunctionExpansion="2" + EnableIntrinsicFunctions="TRUE" + FavorSizeOrSpeed="1" + OmitFramePointers="TRUE" + EnableFiberSafeOptimizations="TRUE" + OptimizeForProcessor="3" OptimizeForWindowsApplication="TRUE" AdditionalIncludeDirectories=".." RuntimeLibrary="2" BufferSecurityCheck="FALSE" + EnableEnhancedInstructionSet="1" RuntimeTypeInfo="TRUE" - WarningLevel="2"/> + WarningLevel="3"/> <Tool Name="VCCustomBuildTool"/> <Tool |
From: <sv...@ww...> - 2004-12-02 17:56:48
|
Author: delta Date: 2004-12-02 09:56:42 -0800 (Thu, 02 Dec 2004) New Revision: 1334 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/VisualStudio2003/SimData.vcproj Log: * Minor update of SimData.vcproj. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1334 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-12-01 05:55:59 UTC (rev 1333) +++ trunk/CSP/SimData/CHANGES.current 2004-12-02 17:56:42 UTC (rev 1334) @@ -1,6 +1,9 @@ Version 0.4.0 (in progress) =========================== +2004-12-02: delta + * Minor update of SimData.vcproj. + 2004-11-30: onsight * Add type statement to trc to declare external types. External types must have stream operators for serializing to Writer and Reader Modified: trunk/CSP/SimData/VisualStudio2003/SimData.vcproj =================================================================== --- trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-12-01 05:55:59 UTC (rev 1333) +++ trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-12-02 17:56:42 UTC (rev 1334) @@ -47,7 +47,7 @@ SuppressStartupBanner="TRUE" DebugInformationFormat="0" CompileAs="2" - DisableSpecificWarnings="4511;4512;4100;4275"/> + DisableSpecificWarnings="4511;4512;4100"/> <Tool Name="VCCustomBuildTool"/> <Tool @@ -122,7 +122,7 @@ SuppressStartupBanner="TRUE" DebugInformationFormat="3" CompileAs="2" - DisableSpecificWarnings="4511;4512;4100;4275;4505"/> + DisableSpecificWarnings="4511;4512;4100"/> <Tool Name="VCCustomBuildTool"/> <Tool |
From: <sv...@ww...> - 2004-12-01 05:56:05
|
Author: mkrose Date: 2004-11-30 21:55:59 -0800 (Tue, 30 Nov 2004) New Revision: 1333 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Tools/TaggedRecordCompiler/parsetab.py trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc_grammar.py trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc_lex.py Log: Add type statement to trc to declare external types. External types must have stream operators for serializing to Writer and Reader streams, as well formatted output to std::ostream (for diagnostics). Using EXTTYPE to represent the external typename, the following functions need to be defined: Reader &operator>>(Reader &, EXTTYPE &); Writer &operator<<(Writer &, EXTTYPE const &); std::ostream &operator<<(std::ostream &, EXTTYPE const &); To use an external type in a trc definition file, just declare the type prior to using it, like this: type EXTTYPE; Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1333 Diff omitted (31277 bytes). |
From: <sv...@ww...> - 2004-11-29 07:03:16
|
Author: mkrose Date: 2004-11-28 23:03:10 -0800 (Sun, 28 Nov 2004) New Revision: 1332 Modified: trunk/CSP/CSPSim/Bin/CompileData.py trunk/CSP/CSPSim/Bin/RebuildData.py trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc.py Log: Set executable flag Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1332 Property changes on: trunk/CSP/CSPSim/Bin/CompileData.py ___________________________________________________________________ Name: svn:executable + * Property changes on: trunk/CSP/CSPSim/Bin/RebuildData.py ___________________________________________________________________ Name: svn:executable + * Property changes on: trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc.py ___________________________________________________________________ Name: svn:executable + * |
From: <sv...@ww...> - 2004-11-22 09:39:24
|
Author: mkrose Date: 2004-11-22 01:39:17 -0800 (Mon, 22 Nov 2004) New Revision: 1331 Modified: trunk/CSP/SimCore/Battlefield/BattlefieldMessages.net trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp trunk/CSP/SimNet/Callbacks.h trunk/CSP/SimNet/NetBase.h trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/PeerInfo.h Log: Replace bitfield in network message header with explicit accessors to improve portability. Added pragma pack(1) to force tight packing. (Still endian-specific though.) Small cleanups in battlefield. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1331 Diff omitted (11076 bytes). |
From: <sv...@ww...> - 2004-11-21 23:38:28
|
Author: mkrose Date: 2004-11-21 15:37:58 -0800 (Sun, 21 Nov 2004) New Revision: 1330 Modified: trunk/CSP/SimNet/NetBase.h trunk/CSP/SimNet/NetworkInterface.cpp Log: Rewrite the packet reader slightly to eliminate MSG_PEEK, which isn't properly supported under Windows. Also dump slightly more verbose header data. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1330 Modified: trunk/CSP/SimNet/NetBase.h =================================================================== --- trunk/CSP/SimNet/NetBase.h 2004-11-21 20:16:27 UTC (rev 1329) +++ trunk/CSP/SimNet/NetBase.h 2004-11-21 23:37:58 UTC (rev 1330) @@ -104,14 +104,15 @@ inline std::ostream &operator <<(std::ostream &os, PacketHeader const &header) { return os << (header.reliable ? 'R' : 'U') << header.priority << ':' << header.statmode << "*" << header.connstat << ':' << header.source << '>' << header.destination - << ':' << header.message_id; + << ':' << header.message_id << ":" + << header.routing_type << ":" << header.routing_data; } /** Helper class for debugging. Dumps a packet receipt header to an output stream. */ inline std::ostream &operator <<(std::ostream &os, PacketReceiptHeader const &header) { - return os << reinterpret_cast<PacketHeader const &>(header) << "<" << header.id0 << "," + return os << reinterpret_cast<PacketHeader const &>(header) << "#" << header.id0 << "," << header.id1 << "," << header.id2 << "," << header.id3; } Modified: trunk/CSP/SimNet/NetworkInterface.cpp =================================================================== --- trunk/CSP/SimNet/NetworkInterface.cpp 2004-11-21 20:16:27 UTC (rev 1329) +++ trunk/CSP/SimNet/NetworkInterface.cpp 2004-11-21 23:37:58 UTC (rev 1330) @@ -46,6 +46,7 @@ #endif #include <cc++/network.h> +#include <string.h> #include <sys/types.h> #include <iostream> #include <map> @@ -386,11 +387,11 @@ assert(m_Initialized); simdata::uint8 *ptr; - PacketReceiptHeader header; + PacketReceiptHeader *header; - const uint32 allocation_size = MaxPayloadLength + HeaderSize; - char null[MaxPayloadLength + HeaderSize]; + char buffer[MaxPayloadLength + ReceiptHeaderSize]; PacketQueue *queue; + header = reinterpret_cast<PacketReceiptHeader*>(buffer); SIMNET_LOG(TIMING, DEBUG, "receive packets; " << (timeout * 1000.0) << " ms available"); int DEBUG_exitcode = 0; @@ -407,101 +408,97 @@ break; } - simdata::uint32 peek_bytes = m_Socket->peek(&header, ReceiptHeaderSize); + // we only need this for initial connections right now, but it must be + // retrieved before the packet data is read. + ost::InetHostAddress sender_addr = m_Socket->getSender(0); + simdata::uint32 packet_length = m_Socket->receive((void*)buffer, sizeof(buffer)); + if (peek_bytes < HeaderSize) { - // bad packet, dump it to the bit bucket - m_Socket->receive((void*)null, sizeof(null)); m_BadPackets++; continue; } - if (header.destination != m_LocalId) { - SIMNET_LOG(PACKET, ALERT, "received bad packet (wrong destination): " << header); - m_Socket->receive((void*)null, sizeof(null)); + if (header->destination != m_LocalId) { + SIMNET_LOG(PACKET, ALERT, "received bad packet (wrong destination): " << *header); m_BadPackets++; continue; } PeerInfo *peer = 0; - simdata::uint16 source = header.source; + simdata::uint16 source = header->source; // for initial connection to the index server, source id will be zero. // we need to create a new id on the fly and translate the source id until // the sender is informed of the correct id to use. // note: whenever source id is zero, routing_data will be set to the receive // port number, and routing type will be zero - if (source == 0 && m_AllowUnknownPeers && header.routing_type == 0) { - ost::InetHostAddress addr = m_Socket->getSender(0); - simdata::uint32 ip = addr.getAddress().s_addr; - ConnectionPoint point(ip, header.routing_data); + if (source == 0 && m_AllowUnknownPeers && header->routing_type == 0) { + simdata::uint32 ip = sender_addr.getAddress().s_addr; + ConnectionPoint point(ip, header->routing_data); source = getSourceId(point); } if (source > 0 && source < PeerIndexSize) peer = &(m_PeerIndex[source]); if (!peer || !peer->isActive()) { - SIMNET_LOG(PACKET, ALERT, "received packet from unknown source: " << header); - m_Socket->receive((void*)null, sizeof(null)); + SIMNET_LOG(PACKET, ALERT, "received packet from unknown source: " << *header); m_BadPackets++; continue; } - peer->getConnStat(&header); + peer->getConnStat(header); DEBUG_count++; // handle reliable udp encoding - if (header.reliable) { - SIMNET_LOG(PACKET, DEBUG, "received a reliable header, pri " << header.priority << ", id0=" << header.id0); + if (header->reliable) { + SIMNET_LOG(PACKET, DEBUG, "received a reliable header, pri " << header->priority << ", id0=" << header->id0); if (peek_bytes >= ReceiptHeaderSize) { // if this packet is priority 3, it requires confirmation (id stored in id0) // there may also be confirmation receipts in the remaining id slots - if (header.priority == 3) { - peer->pushConfirmation(header.id0); + if (header->priority == 3) { + peer->pushConfirmation(header->id0); } else { - if (header.id0 != 0) peer->popConfirmation(header.id0); + if (header->id0 != 0) peer->popConfirmation(header->id0); } - if (header.id1 != 0) peer->popConfirmation(header.id1); - if (header.id2 != 0) peer->popConfirmation(header.id2); - if (header.id3 != 0) peer->popConfirmation(header.id3); + if (header->id1 != 0) peer->popConfirmation(header->id1); + if (header->id2 != 0) peer->popConfirmation(header->id2); + if (header->id3 != 0) peer->popConfirmation(header->id3); } else { - // truncated packet, kill it - m_Socket->receive((void*)null, sizeof(null)); + // truncated packet m_BadPackets++; continue; } } - if (header.message_id == PingID) { - // we've already collected stats from the header (there is no body), + if (header->message_id == PingID) { + // we've already collected stats from the header (there is no body) // so just drop the packet and we're done. - m_Socket->receive((void*)null, sizeof(null)); continue; } - int queue_idx = header.priority; + int queue_idx = header->priority; + SIMNET_LOG(PACKET, INFO, "receiving packet in queue " << queue_idx); queue = m_RxQueues[queue_idx]; - ptr = queue->getWriteBuffer(allocation_size); + ptr = queue->getWriteBuffer(packet_length); if (ptr) { - simdata::uint32 packet_length = m_Socket->receive((void*)ptr, allocation_size); + SIMNET_LOG(PACKET, INFO, "copying packet data (" << peek_bytes << " bytes) " << *header); + memcpy((void*)ptr, (const void*)buffer, peek_bytes); // rewrite the source field, in case we have assigned a new one. reinterpret_cast<PacketHeader*>(ptr)->source = source; - // sanity check - assert(packet_length >= peek_bytes); - peer->tallyReceivedPacket(packet_length); m_ReceivedPackets++; received_packets++; queue->commitWriteBuffer(packet_length); + SIMNET_LOG(PACKET, INFO, "committed packet data (" << packet_length << " bytes)"); } else { // this is a bad state; we have no room left to receive the incoming packet. // for now we just dump it; maybe we can do something smarter eventually. // at least reliable packets will be resent. - simdata::uint32 packet_length = m_Socket->receive((void*)null, sizeof(null)); peer->tallyReceivedPacket(packet_length); m_DroppedPackets++; // next packet may be destined for a queue with space left, so keep trying @@ -590,11 +587,15 @@ } --count; + // XXX remove me! + SIMNET_LOG(PACKET, INFO, "reading packet from receive queue"); simdata::uint8 *ptr = queue->getReadBuffer(size); PacketHeader *header = reinterpret_cast<PacketHeader*>(ptr); simdata::uint32 header_size = (header->reliable ? ReceiptHeaderSize : HeaderSize); simdata::uint8 *payload = ptr + header_size; simdata::uint32 payload_length = size - header_size; + // XXX remove me! + SIMNET_LOG(PACKET, INFO, "found payload " << payload_length << " bytes, " << *header); // pass the packet to all handlers PacketHandlerCallback callback(header, payload, payload_length); |
From: <sv...@ww...> - 2004-11-21 20:17:59
|
Author: mkrose Date: 2004-11-21 12:16:27 -0800 (Sun, 21 Nov 2004) New Revision: 1329 Modified: trunk/CSP/tools/subcmd.py trunk/CSP/tools/sublib.py Log: Add support for files marked as 'replaced'. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1329 Modified: trunk/CSP/tools/subcmd.py =================================================================== --- trunk/CSP/tools/subcmd.py 2004-11-21 20:13:14 UTC (rev 1328) +++ trunk/CSP/tools/subcmd.py 2004-11-21 20:16:27 UTC (rev 1329) @@ -122,6 +122,7 @@ sublib.File.ADD: 'add', sublib.File.DEL: 'delete', sublib.File.MOD: 'modified', + sublib.File.REP: 'replaced', sublib.File.CONFLICT: 'XXX conflict', } Modified: trunk/CSP/tools/sublib.py =================================================================== --- trunk/CSP/tools/sublib.py 2004-11-21 20:13:14 UTC (rev 1328) +++ trunk/CSP/tools/sublib.py 2004-11-21 20:16:27 UTC (rev 1329) @@ -37,6 +37,7 @@ ADD = 'ADD' DEL = 'DEL' MOD = 'MOD' + REP = 'REP' CONFLICT = 'CON' def __init__(self, path, root, mode): @@ -83,6 +84,7 @@ if line.startswith('M'): mode = File.MOD elif line.startswith('A'): mode = File.ADD elif line.startswith('D'): mode = File.DEL + elif line.startswith('R'): mode = File.REP elif line.startswith('C'): mode = File.CONFLICT else: continue files.append(File(relpath, root, mode)) |