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-13 22:32:01
|
Author: delta Date: 2004-12-13 14:31:55 -0800 (Mon, 13 Dec 2004) New Revision: 1378 Modified: trunk/CSP/CSPSim/CHANGES.current Log: Forgotten! Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1378 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-13 19:21:22 UTC (rev 1377) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-13 22:31:55 UTC (rev 1378) @@ -1,6 +1,14 @@ Version 0.4.0 (in progress) =========================== +2004-12-13: delta + * Updated Data/XML/vehicles/aircraft/m2k/thrust.xml with more accurate + m2k data. + + * Added a cutting function on the engine when aoa is too low or high. + + * Slightly moved the aircraft at startup. + 2004-12-12: onsight * Several networking fixes, but the most relevant changes for CSPSim are: @@ -24,6 +32,10 @@ * Improve animations for control surfaces of remote vehicles by interpolating positions. +2004-12-12: delta + * Updated Data/Models/Mirage2000/m2k/model.osg and associated + textures (adding T1.jpg) by Lologramme. + 2004-12-05: delta * Updated CSPSim.vcproj, added SimNet to the build, cleaned up source and header directories and added a custom build step on |
From: <sv...@ww...> - 2004-12-13 19:21:28
|
Author: delta Date: 2004-12-13 11:21:22 -0800 (Mon, 13 Dec 2004) New Revision: 1377 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Config/Config.vcproj trunk/CSP/SimData/Include/SimData/Random.h Log: * Fixed a few warnings in Random.h under msvc. Hopefully gcc won't complain. * Updated Config project file. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1377 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-12-13 19:07:47 UTC (rev 1376) +++ trunk/CSP/SimData/CHANGES.current 2004-12-13 19:21:22 UTC (rev 1377) @@ -1,6 +1,12 @@ Version 0.4.0 (in progress) =========================== +2004-12-12: delta + * Fixed a few warnings in Random.h under msvc. Hopefully gcc + won't complain. + + * Updated Config project file. + 2004-12-11: onsight * Fix a dumb bug in the timing code that caused wildly inaccurate times on windows. @@ -9,7 +15,7 @@ * Changed the level of warnings of cSimData_wrap.cpp and compiled Config as a multithreads dll (vc project files). - * Cleaned a useless vc specific pragma. + * Cleaned up a useless vc specific pragma. * Removed useless static_cast<> in Date.cpp. Modified: trunk/CSP/SimData/Config/Config.vcproj =================================================================== --- trunk/CSP/SimData/Config/Config.vcproj 2004-12-13 19:07:47 UTC (rev 1376) +++ trunk/CSP/SimData/Config/Config.vcproj 2004-12-13 19:21:22 UTC (rev 1377) @@ -18,6 +18,7 @@ <Tool Name="VCCLCompilerTool" RuntimeLibrary="3" + RuntimeTypeInfo="TRUE" WarningLevel="4"/> <Tool Name="VCCustomBuildTool"/> @@ -61,6 +62,7 @@ OptimizeForProcessor="3" OptimizeForWindowsApplication="TRUE" RuntimeLibrary="2" + RuntimeTypeInfo="TRUE" WarningLevel="3"/> <Tool Name="VCCustomBuildTool"/> Modified: trunk/CSP/SimData/Include/SimData/Random.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Random.h 2004-12-13 19:07:47 UTC (rev 1376) +++ trunk/CSP/SimData/Include/SimData/Random.h 2004-12-13 19:21:22 UTC (rev 1377) @@ -464,28 +464,41 @@ * * @param seed the new seed. */ - virtual void setSeed(SeedType seed); + virtual void setSeed(SeedType seed) { + _gen.setSeed(seed); + } /** Save the current state of the generator. * * The state can be restored at any time with setState(). */ - virtual State getState() const; + virtual State getState() const { + RNGState *rng_state = new RNGState; + _gen.getState(rng_state->_state); + return rng_state; + } /** Restore the generator to a specific state saved with getState(). * * The subsequent random numbers will be identical to the sequence * following the corresponding getState() call. */ - virtual void setState(State const &); + virtual void setState(State const &state) { + Ref<RNGState> rng_state = state; + _gen.setState(rng_state->_state); + } /** Return a random floating point value in the range [0,1). */ - virtual double unit(); + virtual double unit() { + return _gen.unit(); + } /** Return a random floating point value in the range [lower,upper). */ - virtual double uniform(double, double); + virtual double uniform(double lower, double upper) { + return _gen.uniform(lower, upper); + } /** Return a random integer in the range lower to upper-1 (inclusive) * @@ -493,11 +506,15 @@ * @param upper upper bound (exclusive) * @returns a random integer int the range lower to upper-1 (inclusive) */ - virtual long uniformInt(long lower, long upper); + virtual long uniformInt(long lower, long upper) { + return _gen.uniformInt(lower, upper); + } /** Equivalent to uniformInt(0, upper) */ - virtual long uniformInt(long upper); + virtual long uniformInt(long upper) { + return _gen.uniformInt(upper); + } /** Return a random integer in the range lower to upper-1 (inclusive) * @@ -505,15 +522,21 @@ * @param upper upper bound (exclusive) * @returns a random integer int the range lower to upper-1 (inclusive) */ - virtual unsigned long uniformUInt(unsigned long lower, unsigned long upper); + virtual unsigned long uniformUInt(unsigned long lower, unsigned long upper) { + return _gen.uniformInt(lower, upper); + } /** Equivalent to uniformUInt(0, upper) */ - virtual unsigned long uniformUInt(unsigned long upper); + virtual unsigned long uniformUInt(unsigned long upper) { + return _gen.uniformInt(upper); + } /** Get the name of this generator */ - virtual std::string getName() const; + virtual std::string getName() const { + return _gen.getName(); + } /** Direct access to the underlying generator. * @@ -523,61 +546,6 @@ inline RNG *operator->() { return &_gen; } }; - -template <class RNG> -RandomInterface::State RandomNumberGenerator<RNG>::getState() const { - RNGState *rng_state = new RNGState; - _gen.getState(rng_state->_state); - return rng_state; -} - -template <class RNG> -void RandomNumberGenerator<RNG>::setState(RandomInterface::State const &state) { - Ref<RNGState> rng_state = state; - _gen.setState(rng_state->_state); -} - -template <class RNG> -void RandomNumberGenerator<RNG>::setSeed(RandomInterface::SeedType seed) { - _gen.setSeed(seed); -} - -template <class RNG> -double RandomNumberGenerator<RNG>::unit() { - return _gen.unit(); -} - -template <class RNG> -double RandomNumberGenerator<RNG>::uniform(double low, double high) { - return _gen.uniform(low, high); -} - -template <class RNG> -long RandomNumberGenerator<RNG>::uniformInt(long low, long high) { - return _gen.uniformInt(low, high); -} - -template <class RNG> -long RandomNumberGenerator<RNG>::uniformInt(long high) { - return _gen.uniformInt(high); -} - -template <class RNG> -unsigned long RandomNumberGenerator<RNG>::uniformUInt(unsigned long low, unsigned long high) { - return _gen.uniformInt(low, high); -} - -template <class RNG> -unsigned long RandomNumberGenerator<RNG>::uniformUInt(unsigned long high) { - return _gen.uniformInt(high); -} - -template <class RNG> -std::string RandomNumberGenerator<RNG>::getName() const { - return _gen.getName(); -} - - /////////////////////////////////////////////////////////////////////////////////// // Random Distributions |
From: <sv...@ww...> - 2004-12-13 19:07:56
|
Author: delta Date: 2004-12-13 11:07:47 -0800 (Mon, 13 Dec 2004) New Revision: 1376 Modified: trunk/CSP/CSPSim/Bin/TestObjects.py trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/thrust.xml trunk/CSP/CSPSim/Include/Engine.h trunk/CSP/CSPSim/Source/Engine.cpp Log: * Updated Data/XML/vehicles/aircraft/m2k/thrust.xml with more accurate m2k data. * Added a cutos function on the engine when aoa is too low or high. * Slightly moved the aircraft at startup. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1376 Diff omitted (13032 bytes). |
From: <sv...@ww...> - 2004-12-13 08:48:56
|
Author: mkrose Date: 2004-12-13 00:48:48 -0800 (Mon, 13 Dec 2004) New Revision: 1375 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/Controller.h trunk/CSP/CSPSim/Source/Controller.cpp Log: Improve animations for control surfaces of remote vehicles by interpolating positions. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1375 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-13 08:17:13 UTC (rev 1374) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-13 08:48:48 UTC (rev 1375) @@ -21,6 +21,9 @@ * Add vehicle acceleration to the bus, and display G-force on the screen. + * Improve animations for control surfaces of remote vehicles by + interpolating positions. + 2004-12-05: delta * Updated CSPSim.vcproj, added SimNet to the build, cleaned up source and header directories and added a custom build step on Modified: trunk/CSP/CSPSim/Include/Controller.h =================================================================== --- trunk/CSP/CSPSim/Include/Controller.h 2004-12-13 08:17:13 UTC (rev 1374) +++ trunk/CSP/CSPSim/Include/Controller.h 2004-12-13 08:48:48 UTC (rev 1375) @@ -35,19 +35,30 @@ namespace simnet { class NetworkMessage; } -class AnimationUpdate { +class RemoteAnimationUpdate { DataChannel<double>::CRef m_Channel; simdata::uint8 m_LastValue; public: - AnimationUpdate(): m_LastValue(0) { } + RemoteAnimationUpdate(): m_LastValue(0) { } void bind(DataChannel<double>::CRef const &channel) { m_Channel = channel; } bool update(); inline simdata::uint8 value() const { return m_LastValue; } inline static double convert(simdata::uint8 value); }; +class LocalAnimationUpdate { + DataChannel<double>::Ref m_Channel; + double m_Target; +public: + LocalAnimationUpdate(): m_Target(0) { } + void bind(DataChannel<double>::Ref const &channel) { m_Channel = channel; } + void setTarget(simdata::uint8 value); + void update(double dt); +}; + + /** Interface for controlling remote copies of an object. */ class RemoteController: public System { @@ -55,11 +66,11 @@ DataChannel<simdata::Vector3>::CRef b_Velocity; DataChannel<simdata::Vector3>::CRef b_AngularVelocity; DataChannel<simdata::Quat>::CRef b_Attitude; - AnimationUpdate m_GearExtension; - AnimationUpdate m_AileronDeflection; - AnimationUpdate m_ElevatorDeflection; - AnimationUpdate m_RudderDeflection; - AnimationUpdate m_AirbrakeDeflection; + RemoteAnimationUpdate m_GearExtension; + RemoteAnimationUpdate m_AileronDeflection; + RemoteAnimationUpdate m_ElevatorDeflection; + RemoteAnimationUpdate m_RudderDeflection; + RemoteAnimationUpdate m_AirbrakeDeflection; int m_UpdateDelay; protected: @@ -92,6 +103,12 @@ DataChannel<double>::Ref b_ElevatorDeflection; DataChannel<double>::Ref b_RudderDeflection; DataChannel<double>::Ref b_AirbrakeDeflection; + LocalAnimationUpdate m_GearExtension; + LocalAnimationUpdate m_AileronDeflection; + LocalAnimationUpdate m_ElevatorDeflection; + LocalAnimationUpdate m_RudderDeflection; + LocalAnimationUpdate m_AirbrakeDeflection; + // dynamic properties DataChannel<simdata::Vector3>::Ref b_Position; DataChannel<simdata::Vector3>::Ref b_Velocity; Modified: trunk/CSP/CSPSim/Source/Controller.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Controller.cpp 2004-12-13 08:17:13 UTC (rev 1374) +++ trunk/CSP/CSPSim/Source/Controller.cpp 2004-12-13 08:48:48 UTC (rev 1375) @@ -55,7 +55,7 @@ m_AirbrakeDeflection.bind(bus->getChannel("ControlSurfaces.AirbrakeDeflection")); } -bool AnimationUpdate::update() { +bool RemoteAnimationUpdate::update() { if (m_Channel.valid()) { simdata::uint8 x = static_cast<simdata::uint8>(100.0 * m_Channel->value() + 128); if (x != m_LastValue) { @@ -66,9 +66,20 @@ return false; } -inline double AnimationUpdate::convert(simdata::uint8 x) { return 0.01 * (static_cast<double>(x) - 128.0); } +void LocalAnimationUpdate::setTarget(simdata::uint8 value) { + m_Target = 0.01 * (static_cast<double>(value) - 128.0); +} +void LocalAnimationUpdate::update(double dt) { + double value = m_Channel->value(); + if (value < m_Target - 0.001) { + m_Channel->value() = std::min(value + 1.0 * dt, m_Target); // ~60 deg/sec + } else if (value > m_Target + 0.001) { + m_Channel->value() = std::max(value - 1.0 * dt, m_Target); // ~60 deg/sec + } +} + simdata::Ref<simnet::NetworkMessage> RemoteController::getUpdate(simcore::TimeStamp current_timestamp, simdata::SimTime interval, int detail) { // TODO (in subclass) compare interval to current_timestamp - last_timestamp to decide if // we need to generate a new message. better, need to find a simple way to cache the @@ -160,6 +171,11 @@ b_Velocity = bus->getSharedChannel(bus::Kinetics::Velocity, true, true); b_AngularVelocity = bus->getSharedChannel(bus::Kinetics::AngularVelocity, true, true); b_Attitude = bus->getSharedChannel(bus::Kinetics::Attitude, true, true); + m_GearExtension.bind(b_GearExtension); + m_AileronDeflection.bind(b_AileronDeflection); + m_ElevatorDeflection.bind(b_ElevatorDeflection); + m_RudderDeflection.bind(b_RudderDeflection); + m_AirbrakeDeflection.bind(b_AirbrakeDeflection); } bool LocalController::sequentialUpdate(simcore::TimeStamp stamp, simcore::TimeStamp now, simdata::SimTime &dt) { @@ -201,16 +217,16 @@ setTargetPosition(update->position().Vector3() + m_TargetVelocity * dt); b_GearExtension->value() = (update->gear_up() ? 0.0 : 1.0); if (update->has_elevator_deflection()) { - b_ElevatorDeflection->value() = AnimationUpdate::convert(update->elevator_deflection()); + m_ElevatorDeflection.setTarget(update->elevator_deflection()); } if (update->has_airbrake_deflection()) { - b_AirbrakeDeflection->value() = AnimationUpdate::convert(update->airbrake_deflection()); + m_AirbrakeDeflection.setTarget(update->airbrake_deflection()); } if (update->has_aileron_deflection()) { - b_AileronDeflection->value() = AnimationUpdate::convert(update->aileron_deflection()); + m_AileronDeflection.setTarget(update->aileron_deflection()); } if (update->has_rudder_deflection()) { - b_RudderDeflection->value() = AnimationUpdate::convert(update->rudder_deflection()); + m_RudderDeflection.setTarget(update->rudder_deflection()); } } else { CSP_LOG(OBJECT, INFO, "non sequential update: msg=" << update->timestamp() << " local=" << now); @@ -242,6 +258,12 @@ if (f > 1.0) f = 1.0; b_Attitude->value().slerp(f, b_Attitude->value(), m_TargetAttitude); } + { + m_ElevatorDeflection.update(dt); + m_AirbrakeDeflection.update(dt); + m_AileronDeflection.update(dt); + m_RudderDeflection.update(dt); + } return 0.0; } |
From: <sv...@ww...> - 2004-12-13 08:17:20
|
Author: mkrose Date: 2004-12-13 00:17:13 -0800 (Mon, 13 Dec 2004) New Revision: 1374 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/AircraftPhysicsModel.h trunk/CSP/CSPSim/Include/DynamicObject.h trunk/CSP/CSPSim/Include/FlightDynamics.h trunk/CSP/CSPSim/Include/KineticsChannels.h trunk/CSP/CSPSim/Include/PhysicsModel.h trunk/CSP/CSPSim/Source/AircraftPhysicsModel.cpp trunk/CSP/CSPSim/Source/DynamicObject.cpp trunk/CSP/CSPSim/Source/FlightDynamics.cpp trunk/CSP/CSPSim/Source/KineticsChannels.cpp trunk/CSP/CSPSim/Source/PhysicsModel.cpp Log: Add vehicle acceleration to the bus, and display G-force on the screen. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1374 Diff omitted (16687 bytes). |
From: <sv...@ww...> - 2004-12-13 07:02:26
|
Author: mkrose Date: 2004-12-12 23:02:19 -0800 (Sun, 12 Dec 2004) New Revision: 1373 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/CSPSim.ini Log: Update ini with new networking options. Networking is disabled by default. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1373 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-12 18:52:12 UTC (rev 1372) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-13 07:02:19 UTC (rev 1373) @@ -15,6 +15,9 @@ problems. Be careful not to pause the sim when testing network play. + * Update ini with new networking options. Networking is disabled by + default. + 2004-12-05: delta * Updated CSPSim.vcproj, added SimNet to the build, cleaned up source and header directories and added a custom build step on Modified: trunk/CSP/CSPSim/Data/CSPSim.ini =================================================================== --- trunk/CSP/CSPSim/Data/CSPSim.ini 2004-12-12 18:52:12 UTC (rev 1372) +++ trunk/CSP/CSPSim/Data/CSPSim.ini 2004-12-13 07:02:19 UTC (rev 1373) @@ -1,58 +1,60 @@ -; CSP configuration settings - -[Debug] -LoggingLevel = 5 -Battlefield = 1 -Demeter = true -LogFile = CSPSim.log - -[Screen] -Width = 1024 -Height = 768 -FullScreen = 0 - -[DemoMode] -FileName = Command.csp -# 0 = PLAY -# 1 = REPLAY -# 2 = RECORD -Mode = 0 - -[Paths] -CachePath = ../Data -InputMapPath = Input -DataPath = ../Data -FontPath = Fonts -ModelPath = Models -ImagePath = Images -SoundPath = Sounds -TerrainPath = Terrain -ConfigPath = ../Data - -[View] -Wireframe = false -ViewDistance = 100000 -Fog = true -FogStart = 10000 -FogEnd = 100000 - -[Testing] -Mute = true -MudBubbleRadius = 40000 -AirBubbleRadius = 80000 -VisualRadius = 40000 -; balkan theater (demeter) -Theater = sim:theater.balkan -Date = 2004-05-09 12:00:00 -; northern CA theater (chunkedLod) -;Theater = sim:theater.nca -;Date = 2003-05-15 14:19:30 - -[Networking] -UseNetworking = false -LocalMessagePort = 3150 -LocalMessageHost = 127.0.0.1 -RemoteMessagePort = 3160 -RemoteMessageHost = 127.0.0.1 - - +; CSP configuration settings + +[Debug] +LoggingLevel = 2 +Battlefield = 1 +Demeter = true +LogFile = CSPSim.log + +[Screen] +Width = 1024 +Height = 768 +FullScreen = 0 + +[DemoMode] +FileName = Command.csp +# 0 = PLAY +# 1 = REPLAY +# 2 = RECORD +Mode = 0 + +[Paths] +CachePath = ../Data +InputMapPath = Input +DataPath = ../Data +FontPath = Fonts +ModelPath = Models +ImagePath = Images +SoundPath = Sounds +TerrainPath = Terrain +ConfigPath = ../Data + +[View] +Wireframe = false +ViewDistance = 100000 +Fog = true +FogStart = 10000 +FogEnd = 100000 + +[Testing] +Mute = true +MudBubbleRadius = 40000 +AirBubbleRadius = 80000 +VisualRadius = 40000 +Theater = sim:theater.balkan +Date = 2004-05-09 12:00:00 +; balkan theater (demeter) +; northern CA theater (chunkedLod) +;Theater = sim:theater.nca +;Date = 2003-05-15 14:19:30 + + +[Networking] +UseNetworking = false +ExternalIp = 127.0.0.1 +LocalIp = 127.0.0.1 +LocalPort = 3161 +ServerIp = 127.0.0.1 +ServerPort = 3160 +IncomingBandwidth = 20000 +OutgoingBandwidth = 20000 |
From: <sv...@ww...> - 2004-12-12 18:52:18
|
Author: mkrose Date: 2004-12-12 10:52:12 -0800 (Sun, 12 Dec 2004) New Revision: 1372 Modified: trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h trunk/CSP/SimNet/ClientServer.cpp trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/NetworkInterface.h trunk/CSP/SimNet/PeerInfo.cpp Log: Fix bandwidth allocation. Was 0/0, which was causing all update packets to be throttled. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1372 Modified: trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h =================================================================== --- trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h 2004-12-12 17:53:43 UTC (rev 1371) +++ trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h 2004-12-12 18:52:12 UTC (rev 1372) @@ -176,7 +176,7 @@ command->setDestination(client_id); command->setRoutingType(ROUTE_COMMAND); command->setReliable(); - m_NetworkServer->queue()->queueMessage(command); + m_NetworkServer->queue()->queueMessage(command, client_id); } void bindCommandDispatch(simnet::DispatchHandler::Ref const &dispatch) { @@ -189,6 +189,7 @@ PlayerJoin::Ref makeJoin(const PeerId id) { PlayerJoin::Ref join = new PlayerJoin(); join->setRoutingType(ROUTE_COMMAND); + join->setReliable(); ClientData &data = m_ClientData[id]; simnet::PeerInfo const *peer_info = m_NetworkServer->getPeer(id); join->set_peer_id(id); @@ -210,11 +211,13 @@ // if the external ips match, these hosts are probably on a LAN and should communicate via their // internal interfaces; otherwise use the external ip. + /* XXX broken since join is shared for all outbound messages if (iter->second.external_ip_addr == new_client_data.external_ip_addr) { join->set_ip_addr(new_client_data.internal_ip_addr); } else { join->set_ip_addr(new_client_data.external_ip_addr); } + */ m_NetworkServer->queue()->queueMessage(join, iter->first); } Modified: trunk/CSP/SimNet/ClientServer.cpp =================================================================== --- trunk/CSP/SimNet/ClientServer.cpp 2004-12-12 17:53:43 UTC (rev 1371) +++ trunk/CSP/SimNet/ClientServer.cpp 2004-12-12 18:52:12 UTC (rev 1372) @@ -117,6 +117,9 @@ SIMNET_LOG(HANDSHAKE, DEBUG, "connection request " << *msg); PeerId client_id = msg->getSource(); ConnectionData &connection_data = m_PendingConnections[client_id]; + if (msg->incoming_bw() < 1000 || msg->outgoing_bw() < 1000) { + SIMNET_LOG(HANDSHAKE, ERROR, "client reports very low bandwidth " << *msg); + } connection_data.incoming_bw = msg->incoming_bw(); connection_data.outgoing_bw = msg->outgoing_bw(); ConnectionResponse::Ref response = new ConnectionResponse(); @@ -132,9 +135,11 @@ SIMNET_LOG(HANDSHAKE, DEBUG, "received acknowledgement " << *msg); PendingConnectionMap::iterator iter = m_PendingConnections.find(msg->getSource()); if (iter == m_PendingConnections.end()) { - SIMNET_LOG(HANDSHAKE, ERROR, "received unsolicited connection acknowledgement from client id " << msg->getSource()); + SIMNET_LOG(HANDSHAKE, WARNING, "received unsolicited connection acknowledgement from client id " << msg->getSource()); return; } + SIMNET_LOG(HANDSHAKE, INFO, "adding client " << msg->getSource() + << " (bw " << (iter->second.incoming_bw) << "/" << (iter->second.outgoing_bw) << ")"); m_NetworkInterface->establishConnection(msg->getSource(), iter->second.incoming_bw, iter->second.outgoing_bw); m_PendingConnections.erase(iter); } @@ -164,6 +169,8 @@ request->setReliable(); request->setRoutingType(0); request->setRoutingData(getLocalNode().getPort()); + request->set_incoming_bw(m_NetworkInterface->getNominalIncomingBandwidth()); + request->set_outgoing_bw(m_NetworkInterface->getNominalOutgoingBandwidth()); m_MessageQueue->queueMessage(request); // wait for a response Modified: trunk/CSP/SimNet/NetworkInterface.cpp =================================================================== --- trunk/CSP/SimNet/NetworkInterface.cpp 2004-12-12 17:53:43 UTC (rev 1371) +++ trunk/CSP/SimNet/NetworkInterface.cpp 2004-12-12 18:52:12 UTC (rev 1372) @@ -153,7 +153,10 @@ // queued packets when a peer disconnects). if (!peer || !peer->isActive()) { // check that this peer id was previously active (not a very stringent test). - assert(peer->getLastDeactivationTime() > 0); + //assert(peer->getLastDeactivationTime() > 0); + if (peer->getLastDeactivationTime() <= 0) { + SIMNET_LOG(PACKET, WARNING, "sending to inacive peer " << header->destination() << " and last deactivation time <= 0 " << (!peer ? "null" : "nonnull")); + } queue->releaseReadBuffer(); continue; } @@ -773,6 +776,7 @@ SIMNET_LOG(PEER, INFO, "connection established with peer " << id); PeerInfo *peer = getPeer(id); if (peer && peer->isActive() && peer->isProvisional()) { + SIMNET_LOG(PEER, INFO, "setting peer bandwidth " << incoming << ", " << outgoing); peer->updateBandwidth(incoming, outgoing); peer->setProvisional(false); } Modified: trunk/CSP/SimNet/NetworkInterface.h =================================================================== --- trunk/CSP/SimNet/NetworkInterface.h 2004-12-12 17:53:43 UTC (rev 1371) +++ trunk/CSP/SimNet/NetworkInterface.h 2004-12-12 18:52:12 UTC (rev 1372) @@ -368,6 +368,16 @@ * recently disconnected. */ PeerId nextDisconnectedPeerId(); + + /** Get the nominal (max) incoming bandwidth, in bytes per second. This is + * the value specified when the network interface was initialized. + */ + inline int getNominalIncomingBandwidth() const { return m_IncomingBandwidth; } + + /** Get the nominal (max) ougoing bandwidth, in bytes per second. This is + * the value specified when the network interface was initialized. + */ + inline int getNominalOutgoingBandwidth() const { return m_OutgoingBandwidth; } }; } // namespace simnet Modified: trunk/CSP/SimNet/PeerInfo.cpp =================================================================== --- trunk/CSP/SimNet/PeerInfo.cpp 2004-12-12 17:53:43 UTC (rev 1371) +++ trunk/CSP/SimNet/PeerInfo.cpp 2004-12-12 18:52:12 UTC (rev 1372) @@ -56,8 +56,8 @@ m_bytes_self_to_peer(0), m_average_outgoing_packet_size(100.0), m_packets_throttled(0), - m_desired_rate_self_to_peer(1), - m_desired_rate_peer_to_self(1), + m_desired_rate_self_to_peer(100), + m_desired_rate_peer_to_self(100), m_allocation_peer_to_self(100), // ~10% of inbound bandwidth initially m_allocation_self_to_peer(100), // ~10% of inbound bandwidth initially m_desired_bandwidth_peer_to_self(0.0), |
From: <sv...@ww...> - 2004-12-12 17:55:27
|
Author: delta Date: 2004-12-12 09:53:43 -0800 (Sun, 12 Dec 2004) New Revision: 1371 Added: trunk/CSP/CSPSim/Data/Models/Mirage2000/T1.jpg Modified: trunk/CSP/CSPSim/Data/Models/Mirage2000/ailed.jpg trunk/CSP/CSPSim/Data/Models/Mirage2000/axces.jpg trunk/CSP/CSPSim/Data/Models/Mirage2000/derive.jpg trunk/CSP/CSPSim/Data/Models/Mirage2000/dessous.jpg trunk/CSP/CSPSim/Data/Models/Mirage2000/fuse.jpg trunk/CSP/CSPSim/Data/Models/Mirage2000/fuseg.jpg trunk/CSP/CSPSim/Data/Models/Mirage2000/model.osg Log: * Updated Data/Models/Mirage2000/m2k/model.osg and associated textures (adding T1.jpg). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1371 Diff omitted (3808910 bytes). |
From: <sv...@ww...> - 2004-12-12 10:41:46
|
Author: mkrose Date: 2004-12-12 02:41:39 -0800 (Sun, 12 Dec 2004) New Revision: 1370 Modified: trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp Log: Make sure all server command responses are set to reliable. Fix an assert that fails when receiving duplicate id allocation packets. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1370 Modified: trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h =================================================================== --- trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h 2004-12-12 10:19:52 UTC (rev 1369) +++ trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h 2004-12-12 10:41:39 UTC (rev 1370) @@ -78,6 +78,7 @@ public: ClientResponse(simnet::NetworkMessage::Ref const &request): m_Response(new MSG()) { m_Response->setReplyTo(request); + m_Response->setReliable(); m_Response->setRoutingType(ROUTE_COMMAND); } inline typename MSG::Ref const &operator->() { return m_Response; } Modified: trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2004-12-12 10:19:52 UTC (rev 1369) +++ trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2004-12-12 10:41:39 UTC (rev 1370) @@ -459,6 +459,7 @@ void LocalBattlefield::onIdAllocationResponse(simdata::Ref<IdAllocationResponse> const &msg, simdata::Ref<simnet::MessageQueue> const &) { SIMNET_LOG(MESSAGE, INFO, *msg); + if (static_cast<ObjectId>(msg->first_id()) == m_LocalIdPool->reserve) return; // duplicate assert(m_LocalIdPool->reserve_limit == 0); m_LocalIdPool->reserve = msg->first_id(); m_LocalIdPool->reserve_limit = msg->first_id() + msg->id_count(); |
From: <sv...@ww...> - 2004-12-12 10:19:59
|
Author: mkrose Date: 2004-12-12 02:19:52 -0800 (Sun, 12 Dec 2004) New Revision: 1369 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/CSPSim.cpp trunk/CSP/CSPSim/Source/Controller.cpp trunk/CSP/IndexServer/IndexServer.cpp trunk/CSP/SimCore/Battlefield/BattlefieldMessages.net trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp trunk/CSP/SimCore/Battlefield/LocalBattlefield.h trunk/CSP/SimNet/ClientServer.cpp trunk/CSP/SimNet/ClientServer.h trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/NetworkInterface.h trunk/CSP/SimNet/NetworkNode.cpp trunk/CSP/SimNet/NetworkNode.h trunk/CSP/SimNet/PeerInfo.cpp Log: Several networking fixes: - Allow clients to specify an external ip address for use behind firewall/routers. When running on a LAN, but connecting to external hosts, use LocalIp to specify the internal ip (e.g. 192.168.0.1) in CSPSim.ini, and ExternalIp to specify the external ip. Be careful to update the latter as needed if you have a dynamic ip assignment. - Log ip addresses on initial connection - Tweak the bandwidth throttling limits to prevent starvation (especially when bootstrapping a new connection). - Set inbound and outbound bandwidths correctly when registering with a server. - Hack to provide a temporary workaround for severe time skew problems. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1369 Diff omitted (29634 bytes). |
From: <sv...@ww...> - 2004-12-11 19:15:56
|
Author: mkrose Date: 2004-12-11 11:15:49 -0800 (Sat, 11 Dec 2004) New Revision: 1368 Added: trunk/CSP/SimNet/Median.h Modified: trunk/CSP/SimCore/Battlefield/GlobalBattlefield.h trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp trunk/CSP/SimCore/Battlefield/LocalBattlefield.h trunk/CSP/SimNet/ClientServer.cpp trunk/CSP/SimNet/ClientServer.h trunk/CSP/SimNet/MessageQueue.h trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/PeerInfo.cpp trunk/CSP/SimNet/PeerInfo.h Log: Time synchronization improvements and fixes: - Send last ping latency as a dedicated field in the ping packet instead of piggybacking on an unused header field. Median filter the roundtrip latency measurement. - Force faster pings immediately after connecting to converge more quickly on the true time offset. Enforce a minimum ping rate after that. - Expose the server time offset from the client interface. - Use the server time offset to correct timestamps used for synchronizing events between peers. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1368 Diff omitted (16118 bytes). |
From: <sv...@ww...> - 2004-12-11 19:02:30
|
Author: mkrose Date: 2004-12-11 11:02:24 -0800 (Sat, 11 Dec 2004) New Revision: 1367 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Source/Timing.cpp Log: Fix a dumb bug in the timing code that caused wildly inaccurate times on windows. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1367 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-12-07 18:03:09 UTC (rev 1366) +++ trunk/CSP/SimData/CHANGES.current 2004-12-11 19:02:24 UTC (rev 1367) @@ -1,12 +1,16 @@ Version 0.4.0 (in progress) =========================== +2004-12-11: onsight + * Fix a dumb bug in the timing code that caused wildly inaccurate + times on windows. + 2004-12-06: delta * Changed the level of warnings of cSimData_wrap.cpp and compiled Config as a multithreads dll (vc project files). - + * Cleaned a useless vc specific pragma. - + * Removed useless static_cast<> in Date.cpp. 2004-12-06: onsight Modified: trunk/CSP/SimData/Source/Timing.cpp =================================================================== --- trunk/CSP/SimData/Source/Timing.cpp 2004-12-07 18:03:09 UTC (rev 1366) +++ trunk/CSP/SimData/Source/Timing.cpp 2004-12-11 19:02:24 UTC (rev 1367) @@ -156,7 +156,7 @@ counter_offset = 1e-7 * static_cast<double>(first_time - SIMDATA_ULL(116444736000000000)); } else { uint64 elapsed_count = counter - first_counter; - uint64 elapsed_time = cvt_filetime(update_time); + uint64 elapsed_time = cvt_filetime(update_time) - first_time; double new_scale = static_cast<double>(elapsed_time) * 1e-7 / elapsed_count; // bump the offset to keep the current calibrated time continuous counter_offset += elapsed_count * (counter_scale - new_scale); |
From: <sv...@ww...> - 2004-12-07 18:03:15
|
Author: delta Date: 2004-12-07 10:03:09 -0800 (Tue, 07 Dec 2004) New Revision: 1366 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Config/Config.vcproj trunk/CSP/SimData/Include/SimData/LogStream.h trunk/CSP/SimData/Source/Date.cpp trunk/CSP/SimData/VisualStudio2003/SimData.vcproj Log: * Changed the level of warnings of cSimData_wrap.cpp and compiled Config as a multithreads dll (vc project files). * Cleaned up a useless vc specific pragma. * Removed useless static_cast<> in Date.cpp. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1366 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-12-07 08:28:24 UTC (rev 1365) +++ trunk/CSP/SimData/CHANGES.current 2004-12-07 18:03:09 UTC (rev 1366) @@ -1,6 +1,14 @@ Version 0.4.0 (in progress) =========================== +2004-12-06: delta + * Changed the level of warnings of cSimData_wrap.cpp and + compiled Config as a multithreads dll (vc project files). + + * Cleaned a useless vc specific pragma. + + * Removed useless static_cast<> in Date.cpp. + 2004-12-06: onsight * Define correct 64-bit integer suffixes for msvc. * Separate 64-bit definitions from other compiler definitions. Modified: trunk/CSP/SimData/Config/Config.vcproj =================================================================== --- trunk/CSP/SimData/Config/Config.vcproj 2004-12-07 08:28:24 UTC (rev 1365) +++ trunk/CSP/SimData/Config/Config.vcproj 2004-12-07 18:03:09 UTC (rev 1366) @@ -17,7 +17,7 @@ ConfigurationType="1"> <Tool Name="VCCLCompilerTool" - RuntimeLibrary="5" + RuntimeLibrary="3" WarningLevel="4"/> <Tool Name="VCCustomBuildTool"/> @@ -60,6 +60,7 @@ EnableFiberSafeOptimizations="TRUE" OptimizeForProcessor="3" OptimizeForWindowsApplication="TRUE" + RuntimeLibrary="2" WarningLevel="3"/> <Tool Name="VCCustomBuildTool"/> Modified: trunk/CSP/SimData/Include/SimData/LogStream.h =================================================================== --- trunk/CSP/SimData/Include/SimData/LogStream.h 2004-12-07 08:28:24 UTC (rev 1365) +++ trunk/CSP/SimData/Include/SimData/LogStream.h 2004-12-07 18:03:09 UTC (rev 1366) @@ -37,11 +37,6 @@ #include <SimData/Export.h> #include <SimData/ThreadBase.h> -#if defined(_MSC_VER) -# pragma warning(disable: 4275) -#endif - - NAMESPACE_SIMDATA Modified: trunk/CSP/SimData/Source/Date.cpp =================================================================== --- trunk/CSP/SimData/Source/Date.cpp 2004-12-07 08:28:24 UTC (rev 1365) +++ trunk/CSP/SimData/Source/Date.cpp 2004-12-07 18:03:09 UTC (rev 1366) @@ -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 += static_cast<year_t>(years); + m_year += 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 -= static_cast<year_t>(years); + m_year -= years; if (m_month > months) { m_month -= months; } else { @@ -124,7 +124,7 @@ } void Date::addYears(int nyears) { - m_year += static_cast<year_t>(nyears); + m_year += nyears; if (m_month == 2 && m_day == 29) { if (!isLeap()) m_day = 28; } @@ -132,7 +132,7 @@ } void Date::subtractYears(int nyears) { - m_year -= static_cast<year_t>(nyears); + m_year -= nyears; if (m_month == 2 && m_day == 29) { if (!isLeap()) m_day = 28; } Modified: trunk/CSP/SimData/VisualStudio2003/SimData.vcproj =================================================================== --- trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-12-07 08:28:24 UTC (rev 1365) +++ trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-12-07 18:03:09 UTC (rev 1366) @@ -181,9 +181,16 @@ <File RelativePath="..\Source\cSimData_wrap.cpp"> <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCLCompilerTool" + WarningLevel="3"/> + </FileConfiguration> + <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" + WarningLevel="3" UndefinePreprocessorDefinitions="_DEBUG"/> </FileConfiguration> </File> |
From: <sv...@ww...> - 2004-12-07 08:28:30
|
Author: mkrose Date: 2004-12-07 00:28:24 -0800 (Tue, 07 Dec 2004) New Revision: 1365 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc_gen.py Log: Tweak trc to suppress warnings under msvc. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1365 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-12-07 08:20:33 UTC (rev 1364) +++ trunk/CSP/SimData/CHANGES.current 2004-12-07 08:28:24 UTC (rev 1365) @@ -3,6 +3,8 @@ 2004-12-06: onsight * Define correct 64-bit integer suffixes for msvc. + * Separate 64-bit definitions from other compiler definitions. + * Tweak trc to suppress warnings under msvc. 2004-12-05: onsight * Fix a couple minor warnings under msvc. Modified: trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc_gen.py =================================================================== --- trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc_gen.py 2004-12-07 08:20:33 UTC (rev 1364) +++ trunk/CSP/SimData/Tools/TaggedRecordCompiler/trc_gen.py 2004-12-07 08:28:24 UTC (rev 1365) @@ -467,24 +467,30 @@ if child.required: child.writeSerializeReader(output) output(child.getHasFlag().getSetString()) - output('for (int tag = reader.nextTag(); tag != 0; tag = reader.nextTag()) {') - output.indent() - output('switch (tag) {') - output.indent() + has_tags = 0 for child in self.children: - if child.required: continue - output('case TAG_%s: {' % child.getId()) + if not child.required: + has_tags = 1 + break + if has_tags: + output('for (int tag = reader.nextTag(); tag != 0; tag = reader.nextTag()) {') output.indent() - child.writeSerializeReader(output) - output(child.getHasFlag().getSetString()) - output('break;') + output('switch (tag) {') + output.indent() + for child in self.children: + if child.required: continue + output('case TAG_%s: {' % child.getId()) + output.indent() + child.writeSerializeReader(output) + output(child.getHasFlag().getSetString()) + output('break;') + output.dedent() + output('}') + output('default: break;') output.dedent() output('}') - output('default: break;') - output.dedent() - output('}') - output.dedent() - output('}') + output.dedent() + output('}') output('reader.endCompound();') output.dedent() output('}\n') |
From: <sv...@ww...> - 2004-12-07 08:20:40
|
Author: mkrose Date: 2004-12-07 00:20:33 -0800 (Tue, 07 Dec 2004) New Revision: 1364 Modified: trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp trunk/CSP/SimData/Include/SimData/Uniform.h Log: Separate 64 bit platform definitions from compiler-specific definitions. Fix more minor warnings... fun, fun. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1364 Modified: trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2004-12-07 05:10:10 UTC (rev 1363) +++ trunk/CSP/SimCore/Battlefield/LocalBattlefield.cpp 2004-12-07 08:20:33 UTC (rev 1364) @@ -747,7 +747,7 @@ const int id = targets[i] & 0xffffff; simnet::NetworkMessage::Ref msg = m_DetailCache[detail].msg; if (msg.valid()) { - m_Connection->send(msg, id); + m_Connection->send(msg, static_cast<PeerId>(id)); } else { CSP_LOG(BATTLEFIELD, ERROR, "no state message"); } @@ -764,7 +764,7 @@ for (unsigned i = 0; i < n; ++i) { if (m_PeerUpdates[i].id == id) { m_PeerUpdates[i].interval = interval_ms; - m_PeerUpdates[i].detail = detail; + m_PeerUpdates[i].detail = static_cast<simdata::uint16>(detail); CSP_LOG(BATTLEFIELD, INFO, "set update interval for peer " << id << " to " << interval_ms << " ms"); return; } Modified: trunk/CSP/SimData/Include/SimData/Uniform.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Uniform.h 2004-12-07 05:10:10 UTC (rev 1363) +++ trunk/CSP/SimData/Include/SimData/Uniform.h 2004-12-07 08:20:33 UTC (rev 1364) @@ -66,15 +66,11 @@ #endif #if defined(_MSC_VER) && (_MSC_VER >= 1310) -# define SIMDATA_STATIC_CONST_DEF(x) -# define SIMDATA_PACKED typedef __int64 int64; typedef unsigned __int64 uint64; # define SIMDATA_ULL(x) x##ull # define SIMDATA_LL(x) x##ll #else -# define SIMDATA_STATIC_CONST_DEF(x) const x -# define SIMDATA_PACKED __attribute__((packed)) // use __extension__ to avoid G++ errors with -pedantic #ifndef SWIG __extension__ @@ -88,6 +84,14 @@ # define SIMDATA_LL(x) x##LL #endif +#if defined(__GNUC__) +# define SIMDATA_STATIC_CONST_DEF(x) const x +# define SIMDATA_PACKED __attribute__((packed)) +#else +# define SIMDATA_STATIC_CONST_DEF(x) +# define SIMDATA_PACKED +#endif + //@} NAMESPACE_SIMDATA_END |
From: <sv...@ww...> - 2004-12-07 05:10:18
|
Author: mkrose Date: 2004-12-06 21:10:10 -0800 (Mon, 06 Dec 2004) New Revision: 1363 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Uniform.h Log: Define correct 64-bit integer suffixes for msvc. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1363 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-12-07 04:43:46 UTC (rev 1362) +++ trunk/CSP/SimData/CHANGES.current 2004-12-07 05:10:10 UTC (rev 1363) @@ -1,6 +1,9 @@ Version 0.4.0 (in progress) =========================== +2004-12-06: onsight + * Define correct 64-bit integer suffixes for msvc. + 2004-12-05: onsight * Fix a couple minor warnings under msvc. * Removed deprecated "default" data archive feature. Modified: trunk/CSP/SimData/Include/SimData/Uniform.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Uniform.h 2004-12-07 04:43:46 UTC (rev 1362) +++ trunk/CSP/SimData/Include/SimData/Uniform.h 2004-12-07 05:10:10 UTC (rev 1363) @@ -70,8 +70,8 @@ # define SIMDATA_PACKED typedef __int64 int64; typedef unsigned __int64 uint64; -# define SIMDATA_ULL(x) x -# define SIMDATA_LL(x) x +# define SIMDATA_ULL(x) x##ull +# define SIMDATA_LL(x) x##ll #else # define SIMDATA_STATIC_CONST_DEF(x) const x # define SIMDATA_PACKED __attribute__((packed)) |
From: <sv...@ww...> - 2004-12-07 04:43:53
|
Author: mkrose Date: 2004-12-06 20:43:46 -0800 (Mon, 06 Dec 2004) New Revision: 1362 Modified: trunk/CSP/SimNet/ClientServer.cpp trunk/CSP/SimNet/NetworkInterface.cpp trunk/CSP/SimNet/NetworkNode.h trunk/CSP/SimNet/PeerInfo.cpp trunk/CSP/SimNet/PeerInfo.h trunk/CSP/SimNet/SConscript trunk/CSP/SimNet/Sockets.h Log: * Add timing data to ping packets to estimate roundtrip latency and clock skew. * Eliminate some minor warning under MSVC. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1362 Diff omitted (11744 bytes). |
From: <sv...@ww...> - 2004-12-06 21:54:28
|
Author: delta Date: 2004-12-06 13:54:22 -0800 (Mon, 06 Dec 2004) New Revision: 1361 Modified: trunk/CSP/SimData/Source/Timing.cpp Log: * Declare 'tries' at the function level and not rely on a persistent declaration after the loop. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1361 Modified: trunk/CSP/SimData/Source/Timing.cpp =================================================================== --- trunk/CSP/SimData/Source/Timing.cpp 2004-12-06 21:02:11 UTC (rev 1360) +++ trunk/CSP/SimData/Source/Timing.cpp 2004-12-06 21:54:22 UTC (rev 1361) @@ -126,7 +126,8 @@ FILETIME start_time, update_time; GetSystemTimeAsFileTime(&start_time); // blocks for up to max_tries * 16 ms on WinXP (assuming 64Hz timer tick) - for (int tries = 0; tries < max_tries; ) { + int tries = 0; + for (; tries < max_tries; ) { uint64 lock_counter = getPerformanceCounter(); GetSystemTimeAsFileTime(&update_time); if (update_time.dwLowDateTime != start_time.dwLowDateTime) { |
From: <sv...@ww...> - 2004-12-06 21:02:18
|
Author: delta Date: 2004-12-06 13:02:11 -0800 (Mon, 06 Dec 2004) New Revision: 1360 Modified: trunk/CSP/SimData/Include/SimData/ThreadBase.h Log: * Added an export symbol on ThreadMutex for vc++. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1360 Modified: trunk/CSP/SimData/Include/SimData/ThreadBase.h =================================================================== --- trunk/CSP/SimData/Include/SimData/ThreadBase.h 2004-12-06 09:31:43 UTC (rev 1359) +++ trunk/CSP/SimData/Include/SimData/ThreadBase.h 2004-12-06 21:02:11 UTC (rev 1360) @@ -52,7 +52,7 @@ * a means of serializing access to a shared resource, such that only * one thread may use the resource at a time. */ -class ThreadMutex: public NonCopyable { +class SIMDATA_EXPORT ThreadMutex: public NonCopyable { friend class ThreadCondition; public: /** Mutex types: |
From: <sv...@ww...> - 2004-12-06 09:31:50
|
Author: mkrose Date: 2004-12-06 01:31:43 -0800 (Mon, 06 Dec 2004) New Revision: 1359 Modified: trunk/CSP/SimData/Source/Timing.cpp Log: Fix a minor warning. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1359 Modified: trunk/CSP/SimData/Source/Timing.cpp =================================================================== --- trunk/CSP/SimData/Source/Timing.cpp 2004-12-06 09:28:53 UTC (rev 1358) +++ trunk/CSP/SimData/Source/Timing.cpp 2004-12-06 09:31:43 UTC (rev 1359) @@ -116,7 +116,7 @@ void calibrateRealTime() { int max_tries = 1; - uint64 counter; + uint64 counter = 0; if (calibrations == 0) { counter_scale = 1.0 / static_cast<double>(getPerformanceFrequency()); max_tries = 10; |
From: <sv...@ww...> - 2004-12-06 09:28:59
|
Author: mkrose Date: 2004-12-06 01:28:53 -0800 (Mon, 06 Dec 2004) New Revision: 1358 Modified: trunk/CSP/SimData/Source/Timing.cpp Log: And fix one more compile error. Maybe not ideal to do linux-edit, svn-submit, win-build, repeat... compile cycles. ;-) Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1358 Modified: trunk/CSP/SimData/Source/Timing.cpp =================================================================== --- trunk/CSP/SimData/Source/Timing.cpp 2004-12-06 09:26:19 UTC (rev 1357) +++ trunk/CSP/SimData/Source/Timing.cpp 2004-12-06 09:28:53 UTC (rev 1358) @@ -129,7 +129,7 @@ for (int tries = 0; tries < max_tries; ) { uint64 lock_counter = getPerformanceCounter(); GetSystemTimeAsFileTime(&update_time); - if (update_time != start_time) { + if (update_time.dwLowDateTime != start_time.dwLowDateTime) { counter = getPerformanceCounter(); // make sure we weren't interrupted between getting the system time and the counter if ((counter - lock_counter) * counter_scale <= 0.0001) break; |
From: <sv...@ww...> - 2004-12-06 09:26:25
|
Author: mkrose Date: 2004-12-06 01:26:19 -0800 (Mon, 06 Dec 2004) New Revision: 1357 Modified: trunk/CSP/SimData/Source/Timing.cpp Log: Fix one last typo. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1357 Modified: trunk/CSP/SimData/Source/Timing.cpp =================================================================== --- trunk/CSP/SimData/Source/Timing.cpp 2004-12-06 09:23:16 UTC (rev 1356) +++ trunk/CSP/SimData/Source/Timing.cpp 2004-12-06 09:26:19 UTC (rev 1357) @@ -164,7 +164,7 @@ } } // schedule the next calibration - next_calibration = counter + static_cast<uint64>(calibration_iterval / counter_scale); + next_calibration = counter + static_cast<uint64>(calibration_interval / counter_scale); } double getCalibratedRealTime() { |
From: <sv...@ww...> - 2004-12-06 09:23:22
|
Author: mkrose Date: 2004-12-06 01:23:16 -0800 (Mon, 06 Dec 2004) New Revision: 1356 Modified: trunk/CSP/SimData/Source/Timing.cpp Log: Fix compile errors in timing code under Windows (thanks to Microsoft's free VC toolkit!). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1356 Modified: trunk/CSP/SimData/Source/Timing.cpp =================================================================== --- trunk/CSP/SimData/Source/Timing.cpp 2004-12-06 09:10:55 UTC (rev 1355) +++ trunk/CSP/SimData/Source/Timing.cpp 2004-12-06 09:23:16 UTC (rev 1356) @@ -24,6 +24,8 @@ */ #include <SimData/Timing.h> +#include <SimData/Log.h> +#include <SimData/Uniform.h> // for platform-specific fast timing routines #ifdef _WIN32 @@ -90,9 +92,9 @@ static double counter_offset = 0.0; static int calibrations = 0; static uint64 next_calibration = 0; - static double calibration_iterval = 10.0; + static double calibration_interval = 10.0; - inline uint64 cvt_largeint(LARGE_INT const &x) { + inline uint64 cvt_filetime(FILETIME const &x) { return (static_cast<uint64>(x.dwHighDateTime) << 32) | static_cast<uint64>(x.dwLowDateTime); } @@ -125,18 +127,18 @@ GetSystemTimeAsFileTime(&start_time); // blocks for up to max_tries * 16 ms on WinXP (assuming 64Hz timer tick) for (int tries = 0; tries < max_tries; ) { - LARGE_INTEGER lock_counter = getPerformanceCounter(); + uint64 lock_counter = getPerformanceCounter(); GetSystemTimeAsFileTime(&update_time); if (update_time != start_time) { counter = getPerformanceCounter(); // make sure we weren't interrupted between getting the system time and the counter - if ((cvt_largeint(counter) - cvt_largeint(lock_counter)) * counter_scale <= 0.0001) break; + if ((counter - lock_counter) * counter_scale <= 0.0001) break; // make sure we weren't interrupted for more than one timer tick. it's still // possible that we could be interrupted for less than 20 ms, causing jitter. // not much to do about that, except to hope that the return of control to // this thread corresponded to a timer tick event so that we are at the start // of the tick window. - if ((update_time - start_time) < SIMDATA_ULL(200000) /* 20 ms */) break; + if ((cvt_filetime(update_time) - cvt_filetime(start_time)) < SIMDATA_ULL(200000) /* 20 ms */) break; // we were probably interrupted (>100us between GSTAFT and QPC), so try again ++tries; } @@ -145,15 +147,15 @@ if (calibrations == 0) { throw TimerError("Unable to calibrate high resolution timer using system time"); } - SIMDATA_LOG(TIME, ERROR, "High resolution timer calibration failed"); + SIMDATA_LOG(LOG_TIME, LOG_ERROR, "High resolution timer calibration failed"); } else { if (calibrations++ == 0) { - first_counter = static_cast<uint64>(counter.QuadPart); - first_time = cvt_largeint(update_time); + first_counter = counter; + first_time = cvt_filetime(update_time); counter_offset = 1e-7 * static_cast<double>(first_time - SIMDATA_ULL(116444736000000000)); } else { - uint64 elapsed_count = static_cast<uint64>(counter.QuadPart) - first_counter; - uint64 elapsed_time = cvt_largeint(update_time); + uint64 elapsed_count = counter - first_counter; + uint64 elapsed_time = cvt_filetime(update_time); double new_scale = static_cast<double>(elapsed_time) * 1e-7 / elapsed_count; // bump the offset to keep the current calibrated time continuous counter_offset += elapsed_count * (counter_scale - new_scale); @@ -162,7 +164,7 @@ } } // schedule the next calibration - next_calibration = counter.QuadPart + static_cast<LONGLONG>(calibration_iterval / counter_scale); + next_calibration = counter + static_cast<uint64>(calibration_iterval / counter_scale); } double getCalibratedRealTime() { |
From: <sv...@ww...> - 2004-12-06 09:11:02
|
Author: mkrose Date: 2004-12-06 01:10:55 -0800 (Mon, 06 Dec 2004) New Revision: 1355 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Date.h trunk/CSP/SimData/Include/SimData/Log.h trunk/CSP/SimData/Include/SimData/Timing.h trunk/CSP/SimData/Source/DataArchive.cpp trunk/CSP/SimData/Source/Timing.cpp Log: Timer upgrades to provide better cross-platform support (work in progress). Also, the second part of the previous change to remove the "default" data archive feature (oops). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1355 Diff omitted (12902 bytes). |
From: <sv...@ww...> - 2004-12-06 09:02:58
|
Author: mkrose Date: 2004-12-06 01:02:51 -0800 (Mon, 06 Dec 2004) New Revision: 1354 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/DataArchive.h Log: Remove deprecated "default" data archive feature. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1354 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-12-06 08:58:10 UTC (rev 1353) +++ trunk/CSP/SimData/CHANGES.current 2004-12-06 09:02:51 UTC (rev 1354) @@ -3,6 +3,7 @@ 2004-12-05: onsight * Fix a couple minor warnings under msvc. + * Removed deprecated "default" data archive feature. 2004-12-03: delta * Updated SimData project files adding a simple project to build Modified: trunk/CSP/SimData/Include/SimData/DataArchive.h =================================================================== --- trunk/CSP/SimData/Include/SimData/DataArchive.h 2004-12-06 08:58:10 UTC (rev 1353) +++ trunk/CSP/SimData/Include/SimData/DataArchive.h 2004-12-06 09:02:51 UTC (rev 1354) @@ -110,20 +110,6 @@ uint32 length; }; - /** Global default archive. - * - * This provides an optional means to share a data archive - * globally in an application. In principle this is not a - * very safe thing to do, but is provided for the convenience - * of hanging yourself. You've been warned. - * - * Use getDefault() and setDefault() to access this variable - * (which may be null). - * - * @deprecated No longer necessary; do not use! - */ - static DataArchive* defaultArchive; - enum { /// number of entries to allocate when growing the entry table AS = 1024, @@ -255,25 +241,6 @@ */ bool isWrite(); - /** Make this archive the "default" archive. - * - * It will remain so until another archive is assigned or it - * is deleted (in which case the dafault reverts to NULL). - * - * @deprecated <em>Use of this default utility is not - * recommended.</em> - */ - void setDefault(); - - /** Get the current default archive. - * - * @returns the current default or NULL if there is none. - * - * @deprecated <em>Use of this default utility is not - * recommended.</em> - */ - static DataArchive* getDefault(); - /** Create a new object from a path identifier string. * * @param path_str The path identifier string. |