From 94df46637aac33da7aab9f23874f372fb23c0d2d Mon Sep 17 00:00:00 2001 From: dhewg Date: Thu, 28 Jun 2012 13:15:40 +0200 Subject: [PATCH] s/WriteLong/WriteInt/ to match the argument type --- neo/d3xp/Entity.cpp | 12 ++-- neo/d3xp/Fx.cpp | 4 +- neo/d3xp/Game_local.cpp | 2 +- neo/d3xp/Game_network.cpp | 18 +++--- neo/d3xp/Light.cpp | 14 ++--- neo/d3xp/Moveable.cpp | 2 +- neo/d3xp/MultiplayerGame.cpp | 10 ++-- neo/d3xp/Player.cpp | 4 +- neo/d3xp/Projectile.cpp | 2 +- neo/d3xp/Weapon.cpp | 2 +- neo/d3xp/physics/Physics_AF.cpp | 2 +- neo/d3xp/physics/Physics_Monster.cpp | 2 +- neo/d3xp/physics/Physics_Parametric.cpp | 4 +- neo/d3xp/physics/Physics_RigidBody.cpp | 2 +- neo/framework/async/AsyncClient.cpp | 72 +++++++++++------------ neo/framework/async/AsyncNetwork.cpp | 2 +- neo/framework/async/AsyncServer.cpp | 78 ++++++++++++------------- neo/framework/async/MsgChannel.cpp | 12 ++-- neo/framework/async/MsgChannel.h | 2 +- neo/game/Entity.cpp | 12 ++-- neo/game/Fx.cpp | 4 +- neo/game/Game_local.cpp | 2 +- neo/game/Game_network.cpp | 18 +++--- neo/game/Light.cpp | 14 ++--- neo/game/Moveable.cpp | 2 +- neo/game/MultiplayerGame.cpp | 10 ++-- neo/game/Player.cpp | 2 +- neo/game/Projectile.cpp | 2 +- neo/game/Weapon.cpp | 2 +- neo/game/physics/Physics_AF.cpp | 2 +- neo/game/physics/Physics_Monster.cpp | 2 +- neo/game/physics/Physics_Parametric.cpp | 4 +- neo/game/physics/Physics_RigidBody.cpp | 2 +- neo/idlib/BitMsg.h | 8 +-- neo/tools/debugger/DebuggerClient.cpp | 6 +- neo/tools/debugger/DebuggerServer.cpp | 10 ++-- 36 files changed, 174 insertions(+), 174 deletions(-) diff --git a/neo/d3xp/Entity.cpp b/neo/d3xp/Entity.cpp index 88692a4d..143ce71a 100644 --- a/neo/d3xp/Entity.cpp +++ b/neo/d3xp/Entity.cpp @@ -1689,7 +1689,7 @@ bool idEntity::StartSoundShader( const idSoundShader *shader, const s_channelTyp msg.Init( msgBuf, sizeof( msgBuf ) ); msg.BeginWriting(); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_SOUND, shader->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_SOUND, shader->Index() ) ); msg.WriteByte( channel ); ServerSendEvent( EVENT_STARTSOUNDSHADER, &msg, false, -1 ); } @@ -4834,7 +4834,7 @@ void idEntity::WriteColorToSnapshot( idBitMsgDelta &msg ) const { color[1] = renderEntity.shaderParms[ SHADERPARM_GREEN ]; color[2] = renderEntity.shaderParms[ SHADERPARM_BLUE ]; color[3] = renderEntity.shaderParms[ SHADERPARM_ALPHA ]; - msg.WriteLong( PackColor( color ) ); + msg.WriteInt( PackColor( color ) ); } /* @@ -4925,7 +4925,7 @@ void idEntity::ServerSendEvent( int eventId, const idBitMsg *msg, bool saveEvent outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( gameLocal.GetSpawnId( this ), 32 ); outMsg.WriteByte( eventId ); - outMsg.WriteLong( gameLocal.time ); + outMsg.WriteInt( gameLocal.time ); if ( msg ) { outMsg.WriteBits( msg->GetSize(), idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); outMsg.WriteData( msg->GetData(), msg->GetSize() ); @@ -4967,7 +4967,7 @@ void idEntity::ClientSendEvent( int eventId, const idBitMsg *msg ) const { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( gameLocal.GetSpawnId( this ), 32 ); outMsg.WriteByte( eventId ); - outMsg.WriteLong( gameLocal.time ); + outMsg.WriteInt( gameLocal.time ); if ( msg ) { outMsg.WriteBits( msg->GetSize(), idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); outMsg.WriteData( msg->GetData(), msg->GetSize() ); @@ -5348,8 +5348,8 @@ void idAnimatedEntity::AddDamageEffect( const trace_t &collision, const idVec3 & msg.WriteFloat( localOrigin[2] ); msg.WriteDir( localNormal, 24 ); msg.WriteDir( localDir, 24 ); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_ENTITYDEF, def->Index() ) ); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_ENTITYDEF, def->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) ); ServerSendEvent( EVENT_ADD_DAMAGE_EFFECT, &msg, false, -1 ); } } diff --git a/neo/d3xp/Fx.cpp b/neo/d3xp/Fx.cpp index d61fdf60..b57116f4 100644 --- a/neo/d3xp/Fx.cpp +++ b/neo/d3xp/Fx.cpp @@ -754,8 +754,8 @@ idEntityFx::WriteToSnapshot void idEntityFx::WriteToSnapshot( idBitMsgDelta &msg ) const { GetPhysics()->WriteToSnapshot( msg ); WriteBindToSnapshot( msg ); - msg.WriteLong( ( fxEffect != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_FX, fxEffect->Index() ) : -1 ); - msg.WriteLong( started ); + msg.WriteInt( ( fxEffect != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_FX, fxEffect->Index() ) : -1 ); + msg.WriteInt( started ); } /* diff --git a/neo/d3xp/Game_local.cpp b/neo/d3xp/Game_local.cpp index cd36bdfe..f1252d2a 100644 --- a/neo/d3xp/Game_local.cpp +++ b/neo/d3xp/Game_local.cpp @@ -4373,7 +4373,7 @@ void idGameLocal::SetPortalState( qhandle_t portal, int blockingBits ) { if ( !gameLocal.isClient ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_PORTAL ); - outMsg.WriteLong( portal ); + outMsg.WriteInt( portal ); outMsg.WriteBits( blockingBits, NUM_RENDER_PORTAL_BITS ); networkSystem->ServerSendReliableMessage( -1, outMsg ); } diff --git a/neo/d3xp/Game_network.cpp b/neo/d3xp/Game_network.cpp index d65be3d9..6895a2f0 100644 --- a/neo/d3xp/Game_network.cpp +++ b/neo/d3xp/Game_network.cpp @@ -183,7 +183,7 @@ void idGameLocal::ServerSendDeclRemapToClient( int clientNum, declType_t type, i outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_REMAP_DECL ); outMsg.WriteByte( type ); - outMsg.WriteLong( index ); + outMsg.WriteInt( index ); outMsg.WriteString( decl->GetName() ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } @@ -333,7 +333,7 @@ void idGameLocal::ServerClientBegin( int clientNum ) { outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SPAWN_PLAYER ); outMsg.WriteByte( clientNum ); - outMsg.WriteLong( spawnIds[ clientNum ] ); + outMsg.WriteInt( spawnIds[ clientNum ] ); networkSystem->ServerSendReliableMessage( -1, outMsg ); } @@ -396,7 +396,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.BeginWriting( ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SPAWN_PLAYER ); outMsg.WriteByte( i ); - outMsg.WriteLong( spawnIds[ i ] ); + outMsg.WriteInt( spawnIds[ i ] ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } @@ -407,7 +407,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( event->spawnId, 32 ); outMsg.WriteByte( event->event ); - outMsg.WriteLong( event->time ); + outMsg.WriteInt( event->time ); outMsg.WriteBits( event->paramsSize, idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); if ( event->paramsSize ) { outMsg.WriteData( event->paramsBuf, event->paramsSize ); @@ -421,7 +421,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_PORTALSTATES ); - outMsg.WriteLong( numPortals ); + outMsg.WriteInt( numPortals ); for ( i = 0; i < numPortals; i++ ) { outMsg.WriteBits( gameRenderWorld->GetPortalState( (qhandle_t) (i+1) ) , NUM_RENDER_PORTAL_BITS ); } @@ -606,7 +606,7 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms #if ASYNC_WRITE_TAGS idRandom tagRandom; tagRandom.SetSeed( random.RandomInt() ); - msg.WriteLong( tagRandom.GetSeed() ); + msg.WriteInt( tagRandom.GetSeed() ); #endif // create the snapshot @@ -657,7 +657,7 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms snapshot->firstEntityState = newBase; #if ASYNC_WRITE_TAGS - msg.WriteLong( tagRandom.RandomInt() ); + msg.WriteInt( tagRandom.RandomInt() ); #endif } } @@ -668,9 +668,9 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms #if ASYNC_WRITE_PVS for ( i = 0; i < idEntity::MAX_PVS_AREAS; i++ ) { if ( i < numSourceAreas ) { - msg.WriteLong( sourceAreas[ i ] ); + msg.WriteInt( sourceAreas[ i ] ); } else { - msg.WriteLong( 0 ); + msg.WriteInt( 0 ); } } gameLocal.pvs.WritePVS( pvsHandle, msg ); diff --git a/neo/d3xp/Light.cpp b/neo/d3xp/Light.cpp index a937c8b2..5f10a704 100644 --- a/neo/d3xp/Light.cpp +++ b/neo/d3xp/Light.cpp @@ -1055,14 +1055,14 @@ void idLight::WriteToSnapshot( idBitMsgDelta &msg ) const { WriteBindToSnapshot( msg ); msg.WriteByte( currentLevel ); - msg.WriteLong( PackColor( baseColor ) ); + msg.WriteInt( PackColor( baseColor ) ); // msg.WriteBits( lightParent.GetEntityNum(), GENTITYNUM_BITS ); /* // only helps prediction - msg.WriteLong( PackColor( fadeFrom ) ); - msg.WriteLong( PackColor( fadeTo ) ); - msg.WriteLong( fadeStart ); - msg.WriteLong( fadeEnd ); + msg.WriteInt( PackColor( fadeFrom ) ); + msg.WriteInt( PackColor( fadeTo ) ); + msg.WriteInt( fadeStart ); + msg.WriteInt( fadeEnd ); */ // FIXME: send renderLight.shader @@ -1070,13 +1070,13 @@ void idLight::WriteToSnapshot( idBitMsgDelta &msg ) const { msg.WriteFloat( renderLight.lightRadius[1], 5, 10 ); msg.WriteFloat( renderLight.lightRadius[2], 5, 10 ); - msg.WriteLong( PackColor( idVec4( renderLight.shaderParms[SHADERPARM_RED], + msg.WriteInt( PackColor( idVec4( renderLight.shaderParms[SHADERPARM_RED], renderLight.shaderParms[SHADERPARM_GREEN], renderLight.shaderParms[SHADERPARM_BLUE], renderLight.shaderParms[SHADERPARM_ALPHA] ) ) ); msg.WriteFloat( renderLight.shaderParms[SHADERPARM_TIMESCALE], 5, 10 ); - msg.WriteLong( renderLight.shaderParms[SHADERPARM_TIMEOFFSET] ); + msg.WriteInt( renderLight.shaderParms[SHADERPARM_TIMEOFFSET] ); //msg.WriteByte( renderLight.shaderParms[SHADERPARM_DIVERSITY] ); msg.WriteShort( renderLight.shaderParms[SHADERPARM_MODE] ); diff --git a/neo/d3xp/Moveable.cpp b/neo/d3xp/Moveable.cpp index f771ecee..b5f95d22 100644 --- a/neo/d3xp/Moveable.cpp +++ b/neo/d3xp/Moveable.cpp @@ -1157,7 +1157,7 @@ void idExplodingBarrel::Killed( idEntity *inflictor, idEntity *attacker, int dam byte msgBuf[MAX_EVENT_PARAM_SIZE]; msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( gameLocal.time ); + msg.WriteInt( gameLocal.time ); ServerSendEvent( EVENT_EXPLODE, &msg, false, -1 ); } } diff --git a/neo/d3xp/MultiplayerGame.cpp b/neo/d3xp/MultiplayerGame.cpp index c199ff30..d0368ecb 100644 --- a/neo/d3xp/MultiplayerGame.cpp +++ b/neo/d3xp/MultiplayerGame.cpp @@ -1500,7 +1500,7 @@ void idMultiplayerGame::NewState( gameState_t news, idPlayer *player ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_WARMUPTIME ); - outMsg.WriteLong( warmupEndTime ); + outMsg.WriteInt( warmupEndTime ); networkSystem->ServerSendReliableMessage( -1, outMsg ); break; @@ -2789,7 +2789,7 @@ void idMultiplayerGame::PlayGlobalSound( int to, snd_evt_t evt, const char *shad return; } outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SOUND_INDEX ); - outMsg.WriteLong( gameLocal.ServerRemapDecl( to, DECL_SOUND, shaderDecl->Index() ) ); + outMsg.WriteInt( gameLocal.ServerRemapDecl( to, DECL_SOUND, shaderDecl->Index() ) ); } else { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SOUND_EVENT ); outMsg.WriteByte( evt ); @@ -4018,7 +4018,7 @@ void idMultiplayerGame::VoiceChat( const idCmdArgs &args, bool team ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_VCHAT ); - outMsg.WriteLong( index ); + outMsg.WriteInt( index ); outMsg.WriteBits( team ? 1 : 0, 1 ); networkSystem->ClientSendReliableMessage( outMsg ); } @@ -4083,7 +4083,7 @@ void idMultiplayerGame::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_STARTSTATE ); // send the game state and start time outMsg.WriteByte( gameState ); - outMsg.WriteLong( matchStartedTime ); + outMsg.WriteInt( matchStartedTime ); outMsg.WriteShort( startFragLimit ); // send the powerup states and the spectate states for( i = 0; i < gameLocal.numClients; i++ ) { @@ -4107,7 +4107,7 @@ void idMultiplayerGame::ServerWriteInitialReliableMessages( int clientNum ) { if ( gameState == COUNTDOWN ) { outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_WARMUPTIME ); - outMsg.WriteLong( warmupEndTime ); + outMsg.WriteInt( warmupEndTime ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } } diff --git a/neo/d3xp/Player.cpp b/neo/d3xp/Player.cpp index ae217f62..c4f110f4 100644 --- a/neo/d3xp/Player.cpp +++ b/neo/d3xp/Player.cpp @@ -9701,10 +9701,10 @@ void idPlayer::WritePlayerStateToSnapshot( idBitMsgDelta &msg ) const { int i; msg.WriteByte( bobCycle ); - msg.WriteLong( stepUpTime ); + msg.WriteInt( stepUpTime ); msg.WriteFloat( stepUpDelta ); #ifdef _D3XP - msg.WriteLong( inventory.weapons ); + msg.WriteInt( inventory.weapons ); #else msg.WriteShort( inventory.weapons ); #endif diff --git a/neo/d3xp/Projectile.cpp b/neo/d3xp/Projectile.cpp index 6e53ce36..935323d5 100644 --- a/neo/d3xp/Projectile.cpp +++ b/neo/d3xp/Projectile.cpp @@ -718,7 +718,7 @@ void idProjectile::AddDefaultDamageEffect( const trace_t &collision, const idVec msg.WriteFloat( collision.c.point[1] ); msg.WriteFloat( collision.c.point[2] ); msg.WriteDir( collision.c.normal, 24 ); - msg.WriteLong( ( collision.c.material != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) : -1 ); + msg.WriteInt( ( collision.c.material != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) : -1 ); msg.WriteFloat( velocity[0], 5, 10 ); msg.WriteFloat( velocity[1], 5, 10 ); msg.WriteFloat( velocity[2], 5, 10 ); diff --git a/neo/d3xp/Weapon.cpp b/neo/d3xp/Weapon.cpp index 79a246fc..802b7f8b 100644 --- a/neo/d3xp/Weapon.cpp +++ b/neo/d3xp/Weapon.cpp @@ -3154,7 +3154,7 @@ void idWeapon::Event_SetSkin( const char *skinname ) { byte msgBuf[MAX_EVENT_PARAM_SIZE]; msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( ( skinDecl != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_SKIN, skinDecl->Index() ) : -1 ); + msg.WriteInt( ( skinDecl != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_SKIN, skinDecl->Index() ) : -1 ); ServerSendEvent( EVENT_CHANGESKIN, &msg, false, -1 ); } } diff --git a/neo/d3xp/physics/Physics_AF.cpp b/neo/d3xp/physics/Physics_AF.cpp index 23e8c466..2aea5e4a 100644 --- a/neo/d3xp/physics/Physics_AF.cpp +++ b/neo/d3xp/physics/Physics_AF.cpp @@ -7925,7 +7925,7 @@ void idPhysics_AF::WriteToSnapshot( idBitMsgDelta &msg ) const { int i; idCQuat quat; - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.noMoveTime ); msg.WriteFloat( current.activateTime ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[0], AF_VELOCITY_EXPONENT_BITS, AF_VELOCITY_MANTISSA_BITS ); diff --git a/neo/d3xp/physics/Physics_Monster.cpp b/neo/d3xp/physics/Physics_Monster.cpp index 1e48b7f9..f3a1606a 100644 --- a/neo/d3xp/physics/Physics_Monster.cpp +++ b/neo/d3xp/physics/Physics_Monster.cpp @@ -780,7 +780,7 @@ void idPhysics_Monster::WriteToSnapshot( idBitMsgDelta &msg ) const { msg.WriteDeltaFloat( 0.0f, current.pushVelocity[0], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[1], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[2], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteBits( current.onGround, 1 ); } diff --git a/neo/d3xp/physics/Physics_Parametric.cpp b/neo/d3xp/physics/Physics_Parametric.cpp index c502ba53..ced21a33 100644 --- a/neo/d3xp/physics/Physics_Parametric.cpp +++ b/neo/d3xp/physics/Physics_Parametric.cpp @@ -1031,8 +1031,8 @@ idPhysics_Parametric::WriteToSnapshot ================ */ void idPhysics_Parametric::WriteToSnapshot( idBitMsgDelta &msg ) const { - msg.WriteLong( current.time ); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.time ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.origin[0] ); msg.WriteFloat( current.origin[1] ); msg.WriteFloat( current.origin[2] ); diff --git a/neo/d3xp/physics/Physics_RigidBody.cpp b/neo/d3xp/physics/Physics_RigidBody.cpp index 2bd77cc0..e1990ef4 100644 --- a/neo/d3xp/physics/Physics_RigidBody.cpp +++ b/neo/d3xp/physics/Physics_RigidBody.cpp @@ -1466,7 +1466,7 @@ void idPhysics_RigidBody::WriteToSnapshot( idBitMsgDelta &msg ) const { quat = current.i.orientation.ToCQuat(); localQuat = current.localAxis.ToCQuat(); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.i.position[0] ); msg.WriteFloat( current.i.position[1] ); msg.WriteFloat( current.i.position[2] ); diff --git a/neo/framework/async/AsyncClient.cpp b/neo/framework/async/AsyncClient.cpp index b8b47558..515351db 100644 --- a/neo/framework/async/AsyncClient.cpp +++ b/neo/framework/async/AsyncClient.cpp @@ -308,7 +308,7 @@ void idAsyncClient::GetServerInfo( const netadr_t adr ) { msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); msg.WriteString( "getInfo" ); - msg.WriteLong( serverList.GetChallenge() ); // challenge + msg.WriteInt( serverList.GetChallenge() ); // challenge clientPort.SendPacket( adr, msg.GetData(), msg.GetSize() ); } @@ -367,7 +367,7 @@ void idAsyncClient::GetLANServers( void ) { msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); msg.WriteString( "getInfo" ); - msg.WriteLong( serverList.GetChallenge() ); + msg.WriteInt( serverList.GetChallenge() ); broadcastAddress.type = NA_BROADCAST; for ( i = 0; i < MAX_SERVER_PORTS; i++ ) { @@ -395,7 +395,7 @@ void idAsyncClient::GetNETServers( void ) { msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); msg.WriteString( "getServers" ); - msg.WriteLong( ASYNC_PROTOCOL_VERSION ); + msg.WriteInt( ASYNC_PROTOCOL_VERSION ); msg.WriteString( cvarSystem->GetCVarString( "fs_game" ) ); msg.WriteBits( cvarSystem->GetCVarInteger( "gui_filter_password" ), 2 ); msg.WriteBits( cvarSystem->GetCVarInteger( "gui_filter_players" ), 2 ); @@ -623,9 +623,9 @@ void idAsyncClient::SendEmptyToServer( bool force, bool mapLoad ) { } msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( serverMessageSequence ); - msg.WriteLong( mapLoad ? GAME_INIT_ID_MAP_LOAD : gameInitId ); - msg.WriteLong( snapshotSequence ); + msg.WriteInt( serverMessageSequence ); + msg.WriteInt( mapLoad ? GAME_INIT_ID_MAP_LOAD : gameInitId ); + msg.WriteInt( snapshotSequence ); msg.WriteByte( CLIENT_UNRELIABLE_MESSAGE_EMPTY ); channel.SendMessage( clientPort, clientTime, msg ); @@ -651,11 +651,11 @@ void idAsyncClient::SendPingResponseToServer( int time ) { } msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( serverMessageSequence ); - msg.WriteLong( gameInitId ); - msg.WriteLong( snapshotSequence ); + msg.WriteInt( serverMessageSequence ); + msg.WriteInt( gameInitId ); + msg.WriteInt( snapshotSequence ); msg.WriteByte( CLIENT_UNRELIABLE_MESSAGE_PINGRESPONSE ); - msg.WriteLong( time ); + msg.WriteInt( time ); channel.SendMessage( clientPort, clientTime, msg ); while( channel.UnsentFragmentsLeft() ) { @@ -686,16 +686,16 @@ void idAsyncClient::SendUsercmdsToServer( void ) { // send the user commands to the server msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( serverMessageSequence ); - msg.WriteLong( gameInitId ); - msg.WriteLong( snapshotSequence ); + msg.WriteInt( serverMessageSequence ); + msg.WriteInt( gameInitId ); + msg.WriteInt( snapshotSequence ); msg.WriteByte( CLIENT_UNRELIABLE_MESSAGE_USERCMD ); msg.WriteShort( clientPrediction ); numUsercmds = idMath::ClampInt( 0, 10, idAsyncNetwork::clientUsercmdBackup.GetInteger() ) + 1; // write the user commands - msg.WriteLong( gameFrame ); + msg.WriteInt( gameFrame ); msg.WriteByte( numUsercmds ); for ( last = NULL, i = gameFrame - numUsercmds + 1; i <= gameFrame; i++ ) { index = i & ( MAX_USERCMD_BACKUP - 1 ); @@ -910,14 +910,14 @@ void idAsyncClient::ProcessReliableMessagePure( const idBitMsg &msg ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( CLIENT_RELIABLE_MESSAGE_PURE ); - outMsg.WriteLong( gameInitId ); + outMsg.WriteInt( gameInitId ); i = 0; while ( inChecksums[ i ] ) { - outMsg.WriteLong( inChecksums[ i++ ] ); + outMsg.WriteInt( inChecksums[ i++ ] ); } - outMsg.WriteLong( 0 ); - outMsg.WriteLong( gamePakChecksum ); + outMsg.WriteInt( 0 ); + outMsg.WriteInt( gamePakChecksum ); if ( !channel.SendReliableMessage( outMsg ) ) { common->Error( "client->server reliable messages overflow\n" ); @@ -1456,18 +1456,18 @@ bool idAsyncClient::ValidatePureServerChecksums( const netadr_t from, const idBi dlmsg.Init( msgBuf, sizeof( msgBuf ) ); dlmsg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); dlmsg.WriteString( "downloadRequest" ); - dlmsg.WriteLong( serverChallenge ); + dlmsg.WriteInt( serverChallenge ); dlmsg.WriteShort( clientId ); // used to make sure the server replies to the same download request - dlmsg.WriteLong( dlRequest ); + dlmsg.WriteInt( dlRequest ); // special case the code pak - if we have a 0 checksum then we don't need to download it - dlmsg.WriteLong( missingGamePakChecksum ); + dlmsg.WriteInt( missingGamePakChecksum ); // 0-terminated list of missing paks i = 0; while ( missingChecksums[ i ] ) { - dlmsg.WriteLong( missingChecksums[ i++ ] ); + dlmsg.WriteInt( missingChecksums[ i++ ] ); } - dlmsg.WriteLong( 0 ); + dlmsg.WriteInt( 0 ); clientPort.SendPacket( from, dlmsg.GetData(), dlmsg.GetSize() ); } @@ -1509,14 +1509,14 @@ void idAsyncClient::ProcessPureMessage( const netadr_t from, const idBitMsg &msg outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); outMsg.WriteString( "pureClient" ); - outMsg.WriteLong( serverChallenge ); + outMsg.WriteInt( serverChallenge ); outMsg.WriteShort( clientId ); i = 0; while ( inChecksums[ i ] ) { - outMsg.WriteLong( inChecksums[ i++ ] ); + outMsg.WriteInt( inChecksums[ i++ ] ); } - outMsg.WriteLong( 0 ); - outMsg.WriteLong( gamePakChecksum ); + outMsg.WriteInt( 0 ); + outMsg.WriteInt( gamePakChecksum ); clientPort.SendPacket( from, outMsg.GetData(), outMsg.GetSize() ); } @@ -1665,24 +1665,24 @@ void idAsyncClient::SetupConnection( void ) { msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); msg.WriteString( "challenge" ); - msg.WriteLong( clientId ); + msg.WriteInt( clientId ); clientPort.SendPacket( serverAddress, msg.GetData(), msg.GetSize() ); } else if ( clientState == CS_CONNECTING ) { common->Printf( "sending connect to %s with challenge 0x%x\n", Sys_NetAdrToString( serverAddress ), serverChallenge ); msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); msg.WriteString( "connect" ); - msg.WriteLong( ASYNC_PROTOCOL_VERSION ); + msg.WriteInt( ASYNC_PROTOCOL_VERSION ); #if ID_FAKE_PURE // fake win32 OS - might need to adapt depending on the case msg.WriteShort( 0 ); #else msg.WriteShort( BUILD_OS_ID ); #endif - msg.WriteLong( clientDataChecksum ); - msg.WriteLong( serverChallenge ); + msg.WriteInt( clientDataChecksum ); + msg.WriteInt( serverChallenge ); msg.WriteShort( clientId ); - msg.WriteLong( cvarSystem->GetCVarInteger( "net_clientMaxRate" ) ); + msg.WriteInt( cvarSystem->GetCVarInteger( "net_clientMaxRate" ) ); msg.WriteString( cvarSystem->GetCVarString( "com_guid" ) ); msg.WriteString( cvarSystem->GetCVarString( "password" ), -1, false ); // do not make the protocol depend on PB @@ -1697,7 +1697,7 @@ void idAsyncClient::SetupConnection( void ) { msg.BeginWriting(); msg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); msg.WriteString( "clAuth" ); - msg.WriteLong( ASYNC_PROTOCOL_VERSION ); + msg.WriteInt( ASYNC_PROTOCOL_VERSION ); msg.WriteNetadr( serverAddress ); // if we don't have a com_guid, this will request a direct reply from auth with it msg.WriteByte( cvarSystem->GetCVarString( "com_guid" )[0] ? 1 : 0 ); @@ -1924,7 +1924,7 @@ void idAsyncClient::SendVersionCheck( bool fromMenu ) { msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); msg.WriteString( "versionCheck" ); - msg.WriteLong( ASYNC_PROTOCOL_VERSION ); + msg.WriteInt( ASYNC_PROTOCOL_VERSION ); msg.WriteShort( BUILD_OS_ID ); msg.WriteString( cvarSystem->GetCVarString( "si_version" ) ); msg.WriteString( cvarSystem->GetCVarString( "com_guid" ) ); @@ -1953,7 +1953,7 @@ void idAsyncClient::SendVersionDLUpdate( int state ) { msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); msg.WriteString( "versionDL" ); - msg.WriteLong( ASYNC_PROTOCOL_VERSION ); + msg.WriteInt( ASYNC_PROTOCOL_VERSION ); msg.WriteShort( state ); clientPort.SendPacket( idAsyncNetwork::GetMasterAddress(), msg.GetData(), msg.GetSize() ); } @@ -2163,7 +2163,7 @@ bool idAsyncClient::SendAuthCheck( const char *cdkey, const char *xpkey ) { msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); msg.WriteString( "gameAuth" ); - msg.WriteLong( ASYNC_PROTOCOL_VERSION ); + msg.WriteInt( ASYNC_PROTOCOL_VERSION ); msg.WriteByte( cdkey ? 1 : 0 ); msg.WriteString( cdkey ? cdkey : "" ); msg.WriteByte( xpkey ? 1 : 0 ); diff --git a/neo/framework/async/AsyncNetwork.cpp b/neo/framework/async/AsyncNetwork.cpp index c8ba93b9..ebd54823 100644 --- a/neo/framework/async/AsyncNetwork.cpp +++ b/neo/framework/async/AsyncNetwork.cpp @@ -205,7 +205,7 @@ void idAsyncNetwork::WriteUserCmdDelta( idBitMsg &msg, const usercmd_t &cmd, con return; } - msg.WriteLong( cmd.gameTime ); + msg.WriteInt( cmd.gameTime ); msg.WriteByte( cmd.buttons ); msg.WriteShort( cmd.mx ); msg.WriteShort( cmd.my ); diff --git a/neo/framework/async/AsyncServer.cpp b/neo/framework/async/AsyncServer.cpp index 0425b1cb..84abdb3b 100644 --- a/neo/framework/async/AsyncServer.cpp +++ b/neo/framework/async/AsyncServer.cpp @@ -769,7 +769,7 @@ void idAsyncServer::DropClient( int clientNum, const char *reason ) { if ( client.clientState >= SCS_PUREWAIT && clientNum != localClientNum ) { msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteByte( SERVER_RELIABLE_MESSAGE_DISCONNECT ); - msg.WriteLong( clientNum ); + msg.WriteInt( clientNum ); msg.WriteString( reason ); for ( i = 0; i < MAX_ASYNC_CLIENTS; i++ ) { // clientNum so SCS_PUREWAIT client gets it's own disconnect msg @@ -918,7 +918,7 @@ void idAsyncServer::SendUserInfoBroadcast( int userInfoNum, const idDict &info, } #if ID_CLIENTINFO_TAGS - msg.WriteLong( sessLocal.mapSpawnData.userInfo[userInfoNum].Checksum() ); + msg.WriteInt( sessLocal.mapSpawnData.userInfo[userInfoNum].Checksum() ); common->DPrintf( "broadcast for client %d: 0x%x\n", userInfoNum, sessLocal.mapSpawnData.userInfo[userInfoNum].Checksum() ); sessLocal.mapSpawnData.userInfo[userInfoNum].Print(); #endif @@ -976,7 +976,7 @@ void idAsyncServer::SendUserInfoToClient( int clientNum, int userInfoNum, const msg.WriteBits( 0, 1 ); #if ID_CLIENTINFO_TAGS - msg.WriteLong( 0 ); + msg.WriteInt( 0 ); common->DPrintf( "user info %d to client %d: NULL base\n", userInfoNum, clientNum ); #endif @@ -1039,7 +1039,7 @@ void idAsyncServer::SendApplySnapshotToClient( int clientNum, int sequence ) { msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteByte( SERVER_RELIABLE_MESSAGE_APPLYSNAPSHOT ); - msg.WriteLong( sequence ); + msg.WriteInt( sequence ); SendReliableMessage( clientNum, msg ); } @@ -1068,7 +1068,7 @@ bool idAsyncServer::SendEmptyToClient( int clientNum, bool force ) { } msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( gameInitId ); + msg.WriteInt( gameInitId ); msg.WriteByte( SERVER_UNRELIABLE_MESSAGE_EMPTY ); client.channel.SendMessage( serverPort, serverTime, msg ); @@ -1102,9 +1102,9 @@ bool idAsyncServer::SendPingToClient( int clientNum ) { } msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( gameInitId ); + msg.WriteInt( gameInitId ); msg.WriteByte( SERVER_UNRELIABLE_MESSAGE_PING ); - msg.WriteLong( realTime ); + msg.WriteInt( realTime ); client.channel.SendMessage( serverPort, serverTime, msg ); @@ -1134,10 +1134,10 @@ void idAsyncServer::SendGameInitToClient( int clientNum ) { } msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( gameInitId ); + msg.WriteInt( gameInitId ); msg.WriteByte( SERVER_UNRELIABLE_MESSAGE_GAMEINIT ); - msg.WriteLong( gameFrame ); - msg.WriteLong( gameTime ); + msg.WriteInt( gameFrame ); + msg.WriteInt( gameTime ); msg.WriteDeltaDict( sessLocal.mapSpawnData.serverInfo, NULL ); client.gameInitSequence = client.channel.SendMessage( serverPort, serverTime, msg ); } @@ -1169,11 +1169,11 @@ bool idAsyncServer::SendSnapshotToClient( int clientNum ) { // write the snapshot msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( gameInitId ); + msg.WriteInt( gameInitId ); msg.WriteByte( SERVER_UNRELIABLE_MESSAGE_SNAPSHOT ); - msg.WriteLong( client.snapshotSequence ); - msg.WriteLong( gameFrame ); - msg.WriteLong( gameTime ); + msg.WriteInt( client.snapshotSequence ); + msg.WriteInt( gameFrame ); + msg.WriteInt( gameTime ); msg.WriteByte( idMath::ClampChar( client.numDuplicatedUsercmds ) ); msg.WriteShort( idMath::ClampShort( client.clientAheadTime ) ); @@ -1523,7 +1523,7 @@ void idAsyncServer::ProcessChallengeMessage( const netadr_t from, const idBitMsg outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); outMsg.WriteString( "challengeResponse" ); - outMsg.WriteLong( challenges[i].challenge ); + outMsg.WriteInt( challenges[i].challenge ); outMsg.WriteShort( serverId ); outMsg.WriteString( cvarSystem->GetCVarString( "fs_game_base" ) ); outMsg.WriteString( cvarSystem->GetCVarString( "fs_game" ) ); @@ -1542,9 +1542,9 @@ void idAsyncServer::ProcessChallengeMessage( const netadr_t from, const idBitMsg outMsg.BeginWriting(); outMsg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); outMsg.WriteString( "srvAuth" ); - outMsg.WriteLong( ASYNC_PROTOCOL_VERSION ); + outMsg.WriteInt( ASYNC_PROTOCOL_VERSION ); outMsg.WriteNetadr( from ); - outMsg.WriteLong( -1 ); // this identifies "challenge" auth vs "connect" auth + outMsg.WriteInt( -1 ); // this identifies "challenge" auth vs "connect" auth // protocol 1.37 addition outMsg.WriteByte( fileSystem->RunningD3XP() ); serverPort.SendPacket( idAsyncNetwork::GetMasterAddress(), outMsg.GetData(), outMsg.GetSize() ); @@ -1579,12 +1579,12 @@ bool idAsyncServer::SendPureServerMessage( const netadr_t to, int OS ) { i = 0; while ( serverChecksums[ i ] ) { - outMsg.WriteLong( serverChecksums[ i++ ] ); + outMsg.WriteInt( serverChecksums[ i++ ] ); } - outMsg.WriteLong( 0 ); + outMsg.WriteInt( 0 ); // write the pak checksum for game code - outMsg.WriteLong( gamePakChecksum ); + outMsg.WriteInt( gamePakChecksum ); serverPort.SendPacket( to, outMsg.GetData(), outMsg.GetSize() ); return true; @@ -1614,14 +1614,14 @@ bool idAsyncServer::SendReliablePureToClient( int clientNum ) { msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteByte( SERVER_RELIABLE_MESSAGE_PURE ); - msg.WriteLong( gameInitId ); + msg.WriteInt( gameInitId ); i = 0; while ( serverChecksums[ i ] ) { - msg.WriteLong( serverChecksums[ i++ ] ); + msg.WriteInt( serverChecksums[ i++ ] ); } - msg.WriteLong( 0 ); - msg.WriteLong( gamePakChecksum ); + msg.WriteInt( 0 ); + msg.WriteInt( gamePakChecksum ); SendReliableMessage( clientNum, msg ); @@ -1751,9 +1751,9 @@ void idAsyncServer::ProcessConnectMessage( const netadr_t from, const idBitMsg & outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); outMsg.WriteString( "srvAuth" ); - outMsg.WriteLong( ASYNC_PROTOCOL_VERSION ); + outMsg.WriteInt( ASYNC_PROTOCOL_VERSION ); outMsg.WriteNetadr( from ); - outMsg.WriteLong( clientId ); + outMsg.WriteInt( clientId ); outMsg.WriteString( guid ); // protocol 1.37 addition outMsg.WriteByte( fileSystem->RunningD3XP() ); @@ -1785,8 +1785,8 @@ void idAsyncServer::ProcessConnectMessage( const netadr_t from, const idBitMsg & outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); outMsg.WriteString( "print" ); - outMsg.WriteLong( SERVER_PRINT_GAMEDENY ); - outMsg.WriteLong( reply ); + outMsg.WriteInt( SERVER_PRINT_GAMEDENY ); + outMsg.WriteInt( reply ); outMsg.WriteString( reason ); serverPort.SendPacket( from, outMsg.GetData(), outMsg.GetSize() ); @@ -1860,10 +1860,10 @@ void idAsyncServer::ProcessConnectMessage( const netadr_t from, const idBitMsg & outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); outMsg.WriteString( "connectResponse" ); - outMsg.WriteLong( clientNum ); - outMsg.WriteLong( gameInitId ); - outMsg.WriteLong( gameFrame ); - outMsg.WriteLong( gameTime ); + outMsg.WriteInt( clientNum ); + outMsg.WriteInt( gameInitId ); + outMsg.WriteInt( gameFrame ); + outMsg.WriteInt( gameTime ); outMsg.WriteDeltaDict( sessLocal.mapSpawnData.serverInfo, NULL ); serverPort.SendPacket( from, outMsg.GetData(), outMsg.GetSize() ); @@ -2075,8 +2075,8 @@ void idAsyncServer::ProcessGetInfoMessage( const netadr_t from, const idBitMsg & outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); outMsg.WriteString( "infoResponse" ); - outMsg.WriteLong( challenge ); - outMsg.WriteLong( ASYNC_PROTOCOL_VERSION ); + outMsg.WriteInt( challenge ); + outMsg.WriteInt( ASYNC_PROTOCOL_VERSION ); outMsg.WriteDeltaDict( sessLocal.mapSpawnData.serverInfo, NULL ); for ( i = 0; i < MAX_ASYNC_CLIENTS; i++ ) { @@ -2088,11 +2088,11 @@ void idAsyncServer::ProcessGetInfoMessage( const netadr_t from, const idBitMsg & outMsg.WriteByte( i ); outMsg.WriteShort( client.clientPing ); - outMsg.WriteLong( client.channel.GetMaxOutgoingRate() ); + outMsg.WriteInt( client.channel.GetMaxOutgoingRate() ); outMsg.WriteString( sessLocal.mapSpawnData.userInfo[i].GetString( "ui_name", "Player" ) ); } outMsg.WriteByte( MAX_ASYNC_CLIENTS ); - outMsg.WriteLong( fileSystem->GetOSMask() ); + outMsg.WriteInt( fileSystem->GetOSMask() ); serverPort.SendPacket( from, outMsg.GetData(), outMsg.GetSize() ); } @@ -2578,7 +2578,7 @@ void idAsyncServer::PrintOOB( const netadr_t to, int opcode, const char *string outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); outMsg.WriteString( "print" ); - outMsg.WriteLong( opcode ); + outMsg.WriteInt( opcode ); outMsg.WriteString( string ); serverPort.SendPacket( to, outMsg.GetData(), outMsg.GetSize() ); } @@ -2741,7 +2741,7 @@ void idAsyncServer::ProcessDownloadRequestMessage( const netadr_t from, const id outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteShort( CONNECTIONLESS_MESSAGE_ID ); outMsg.WriteString( "downloadInfo" ); - outMsg.WriteLong( dlRequest ); + outMsg.WriteInt( dlRequest ); if ( !game->DownloadRequest( Sys_NetAdrToString( from ), challenges[ iclient ].guid, paklist.c_str(), pakbuf ) ) { common->DPrintf( "game: no downloads\n" ); outMsg.WriteByte( SERVER_DL_NONE ); @@ -2803,7 +2803,7 @@ void idAsyncServer::ProcessDownloadRequestMessage( const netadr_t from, const id tmpMsg.WriteByte( SERVER_PAK_YES ); tmpMsg.WriteString( pakNames[ i ] ); tmpMsg.WriteString( pakURLs[ i ] ); - tmpMsg.WriteLong( dlSize[ i ] ); + tmpMsg.WriteInt( dlSize[ i ] ); } // keep last 5 bytes for an 'end of message' - SERVER_PAK_END and the totalDlSize long diff --git a/neo/framework/async/MsgChannel.cpp b/neo/framework/async/MsgChannel.cpp index b6c6cc23..25f3663f 100644 --- a/neo/framework/async/MsgChannel.cpp +++ b/neo/framework/async/MsgChannel.cpp @@ -86,7 +86,7 @@ bool idMsgQueue::Add( const byte *data, const int size ) { } int sequence = last; WriteShort( size ); - WriteLong( sequence ); + WriteInt( sequence ); WriteData( data, size ); last++; return true; @@ -193,10 +193,10 @@ int idMsgQueue::ReadShort( void ) { /* =============== -idMsgQueue::WriteLong +idMsgQueue::WriteInt =============== */ -void idMsgQueue::WriteLong( int l ) { +void idMsgQueue::WriteInt( int l ) { WriteByte( ( l >> 0 ) & 255 ); WriteByte( ( l >> 8 ) & 255 ); WriteByte( ( l >> 16 ) & 255 ); @@ -338,7 +338,7 @@ void idMsgChannel::WriteMessageData( idBitMsg &out, const idBitMsg &msg ) { tmp.Init( tmpBuf, sizeof( tmpBuf ) ); // write acknowledgement of last received reliable message - tmp.WriteLong( reliableReceive.GetLast() ); + tmp.WriteInt( reliableReceive.GetLast() ); // write reliable messages reliableSend.CopyToBuffer( tmp.GetData() + tmp.GetSize() ); @@ -428,7 +428,7 @@ void idMsgChannel::SendNextFragment( idPort &port, const int time ) { // write the packet msg.Init( msgBuf, sizeof( msgBuf ) ); msg.WriteShort( id ); - msg.WriteLong( outgoingSequence | FRAGMENT_BIT ); + msg.WriteInt( outgoingSequence | FRAGMENT_BIT ); fragLength = FRAGMENT_SIZE; if ( unsentFragmentStart + fragLength > unsentMsg.GetSize() ) { @@ -507,7 +507,7 @@ int idMsgChannel::SendMessage( idPort &port, const int time, const idBitMsg &msg // write the header unsentMsg.WriteShort( id ); - unsentMsg.WriteLong( outgoingSequence ); + unsentMsg.WriteInt( outgoingSequence ); // write out the message data WriteMessageData( unsentMsg, msg ); diff --git a/neo/framework/async/MsgChannel.h b/neo/framework/async/MsgChannel.h index 34b0fc62..8798a730 100644 --- a/neo/framework/async/MsgChannel.h +++ b/neo/framework/async/MsgChannel.h @@ -81,7 +81,7 @@ private: byte ReadByte( void ); void WriteShort( int s ); int ReadShort( void ); - void WriteLong( int l ); + void WriteInt( int l ); int ReadLong( void ); void WriteData( const byte *data, const int size ); void ReadData( byte *data, const int size ); diff --git a/neo/game/Entity.cpp b/neo/game/Entity.cpp index f7776dc7..2f4c59c8 100644 --- a/neo/game/Entity.cpp +++ b/neo/game/Entity.cpp @@ -1597,7 +1597,7 @@ bool idEntity::StartSoundShader( const idSoundShader *shader, const s_channelTyp msg.Init( msgBuf, sizeof( msgBuf ) ); msg.BeginWriting(); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_SOUND, shader->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_SOUND, shader->Index() ) ); msg.WriteByte( channel ); ServerSendEvent( EVENT_STARTSOUNDSHADER, &msg, false, -1 ); } @@ -4660,7 +4660,7 @@ void idEntity::WriteColorToSnapshot( idBitMsgDelta &msg ) const { color[1] = renderEntity.shaderParms[ SHADERPARM_GREEN ]; color[2] = renderEntity.shaderParms[ SHADERPARM_BLUE ]; color[3] = renderEntity.shaderParms[ SHADERPARM_ALPHA ]; - msg.WriteLong( PackColor( color ) ); + msg.WriteInt( PackColor( color ) ); } /* @@ -4751,7 +4751,7 @@ void idEntity::ServerSendEvent( int eventId, const idBitMsg *msg, bool saveEvent outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( gameLocal.GetSpawnId( this ), 32 ); outMsg.WriteByte( eventId ); - outMsg.WriteLong( gameLocal.time ); + outMsg.WriteInt( gameLocal.time ); if ( msg ) { outMsg.WriteBits( msg->GetSize(), idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); outMsg.WriteData( msg->GetData(), msg->GetSize() ); @@ -4793,7 +4793,7 @@ void idEntity::ClientSendEvent( int eventId, const idBitMsg *msg ) const { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( gameLocal.GetSpawnId( this ), 32 ); outMsg.WriteByte( eventId ); - outMsg.WriteLong( gameLocal.time ); + outMsg.WriteInt( gameLocal.time ); if ( msg ) { outMsg.WriteBits( msg->GetSize(), idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); outMsg.WriteData( msg->GetData(), msg->GetSize() ); @@ -5140,8 +5140,8 @@ void idAnimatedEntity::AddDamageEffect( const trace_t &collision, const idVec3 & msg.WriteFloat( localOrigin[2] ); msg.WriteDir( localNormal, 24 ); msg.WriteDir( localDir, 24 ); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_ENTITYDEF, def->Index() ) ); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_ENTITYDEF, def->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) ); ServerSendEvent( EVENT_ADD_DAMAGE_EFFECT, &msg, false, -1 ); } } diff --git a/neo/game/Fx.cpp b/neo/game/Fx.cpp index 8ee3e7ca..1ab4f752 100644 --- a/neo/game/Fx.cpp +++ b/neo/game/Fx.cpp @@ -724,8 +724,8 @@ idEntityFx::WriteToSnapshot void idEntityFx::WriteToSnapshot( idBitMsgDelta &msg ) const { GetPhysics()->WriteToSnapshot( msg ); WriteBindToSnapshot( msg ); - msg.WriteLong( ( fxEffect != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_FX, fxEffect->Index() ) : -1 ); - msg.WriteLong( started ); + msg.WriteInt( ( fxEffect != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_FX, fxEffect->Index() ) : -1 ); + msg.WriteInt( started ); } /* diff --git a/neo/game/Game_local.cpp b/neo/game/Game_local.cpp index 0f9cbae0..2f81739c 100644 --- a/neo/game/Game_local.cpp +++ b/neo/game/Game_local.cpp @@ -4074,7 +4074,7 @@ void idGameLocal::SetPortalState( qhandle_t portal, int blockingBits ) { if ( !gameLocal.isClient ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_PORTAL ); - outMsg.WriteLong( portal ); + outMsg.WriteInt( portal ); outMsg.WriteBits( blockingBits, NUM_RENDER_PORTAL_BITS ); networkSystem->ServerSendReliableMessage( -1, outMsg ); } diff --git a/neo/game/Game_network.cpp b/neo/game/Game_network.cpp index 0a1b07a0..5e2cfe10 100644 --- a/neo/game/Game_network.cpp +++ b/neo/game/Game_network.cpp @@ -183,7 +183,7 @@ void idGameLocal::ServerSendDeclRemapToClient( int clientNum, declType_t type, i outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_REMAP_DECL ); outMsg.WriteByte( type ); - outMsg.WriteLong( index ); + outMsg.WriteInt( index ); outMsg.WriteString( decl->GetName() ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } @@ -333,7 +333,7 @@ void idGameLocal::ServerClientBegin( int clientNum ) { outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SPAWN_PLAYER ); outMsg.WriteByte( clientNum ); - outMsg.WriteLong( spawnIds[ clientNum ] ); + outMsg.WriteInt( spawnIds[ clientNum ] ); networkSystem->ServerSendReliableMessage( -1, outMsg ); } @@ -396,7 +396,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.BeginWriting( ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SPAWN_PLAYER ); outMsg.WriteByte( i ); - outMsg.WriteLong( spawnIds[ i ] ); + outMsg.WriteInt( spawnIds[ i ] ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } @@ -407,7 +407,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( event->spawnId, 32 ); outMsg.WriteByte( event->event ); - outMsg.WriteLong( event->time ); + outMsg.WriteInt( event->time ); outMsg.WriteBits( event->paramsSize, idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); if ( event->paramsSize ) { outMsg.WriteData( event->paramsBuf, event->paramsSize ); @@ -421,7 +421,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_PORTALSTATES ); - outMsg.WriteLong( numPortals ); + outMsg.WriteInt( numPortals ); for ( i = 0; i < numPortals; i++ ) { outMsg.WriteBits( gameRenderWorld->GetPortalState( (qhandle_t) (i+1) ) , NUM_RENDER_PORTAL_BITS ); } @@ -592,7 +592,7 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms #if ASYNC_WRITE_TAGS idRandom tagRandom; tagRandom.SetSeed( random.RandomInt() ); - msg.WriteLong( tagRandom.GetSeed() ); + msg.WriteInt( tagRandom.GetSeed() ); #endif // create the snapshot @@ -643,7 +643,7 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms snapshot->firstEntityState = newBase; #if ASYNC_WRITE_TAGS - msg.WriteLong( tagRandom.RandomInt() ); + msg.WriteInt( tagRandom.RandomInt() ); #endif } } @@ -654,9 +654,9 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms #if ASYNC_WRITE_PVS for ( i = 0; i < idEntity::MAX_PVS_AREAS; i++ ) { if ( i < numSourceAreas ) { - msg.WriteLong( sourceAreas[ i ] ); + msg.WriteInt( sourceAreas[ i ] ); } else { - msg.WriteLong( 0 ); + msg.WriteInt( 0 ); } } gameLocal.pvs.WritePVS( pvsHandle, msg ); diff --git a/neo/game/Light.cpp b/neo/game/Light.cpp index a195b35a..75a3c1b4 100644 --- a/neo/game/Light.cpp +++ b/neo/game/Light.cpp @@ -1048,14 +1048,14 @@ void idLight::WriteToSnapshot( idBitMsgDelta &msg ) const { WriteBindToSnapshot( msg ); msg.WriteByte( currentLevel ); - msg.WriteLong( PackColor( baseColor ) ); + msg.WriteInt( PackColor( baseColor ) ); // msg.WriteBits( lightParent.GetEntityNum(), GENTITYNUM_BITS ); /* // only helps prediction - msg.WriteLong( PackColor( fadeFrom ) ); - msg.WriteLong( PackColor( fadeTo ) ); - msg.WriteLong( fadeStart ); - msg.WriteLong( fadeEnd ); + msg.WriteInt( PackColor( fadeFrom ) ); + msg.WriteInt( PackColor( fadeTo ) ); + msg.WriteInt( fadeStart ); + msg.WriteInt( fadeEnd ); */ // FIXME: send renderLight.shader @@ -1063,13 +1063,13 @@ void idLight::WriteToSnapshot( idBitMsgDelta &msg ) const { msg.WriteFloat( renderLight.lightRadius[1], 5, 10 ); msg.WriteFloat( renderLight.lightRadius[2], 5, 10 ); - msg.WriteLong( PackColor( idVec4( renderLight.shaderParms[SHADERPARM_RED], + msg.WriteInt( PackColor( idVec4( renderLight.shaderParms[SHADERPARM_RED], renderLight.shaderParms[SHADERPARM_GREEN], renderLight.shaderParms[SHADERPARM_BLUE], renderLight.shaderParms[SHADERPARM_ALPHA] ) ) ); msg.WriteFloat( renderLight.shaderParms[SHADERPARM_TIMESCALE], 5, 10 ); - msg.WriteLong( renderLight.shaderParms[SHADERPARM_TIMEOFFSET] ); + msg.WriteInt( renderLight.shaderParms[SHADERPARM_TIMEOFFSET] ); //msg.WriteByte( renderLight.shaderParms[SHADERPARM_DIVERSITY] ); msg.WriteShort( renderLight.shaderParms[SHADERPARM_MODE] ); diff --git a/neo/game/Moveable.cpp b/neo/game/Moveable.cpp index 13bd7be5..942196c4 100644 --- a/neo/game/Moveable.cpp +++ b/neo/game/Moveable.cpp @@ -993,7 +993,7 @@ void idExplodingBarrel::Killed( idEntity *inflictor, idEntity *attacker, int dam byte msgBuf[MAX_EVENT_PARAM_SIZE]; msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( gameLocal.time ); + msg.WriteInt( gameLocal.time ); ServerSendEvent( EVENT_EXPLODE, &msg, false, -1 ); } } diff --git a/neo/game/MultiplayerGame.cpp b/neo/game/MultiplayerGame.cpp index c21df329..f600fca1 100644 --- a/neo/game/MultiplayerGame.cpp +++ b/neo/game/MultiplayerGame.cpp @@ -1057,7 +1057,7 @@ void idMultiplayerGame::NewState( gameState_t news, idPlayer *player ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_WARMUPTIME ); - outMsg.WriteLong( warmupEndTime ); + outMsg.WriteInt( warmupEndTime ); networkSystem->ServerSendReliableMessage( -1, outMsg ); break; @@ -2183,7 +2183,7 @@ void idMultiplayerGame::PlayGlobalSound( int to, snd_evt_t evt, const char *shad return; } outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SOUND_INDEX ); - outMsg.WriteLong( gameLocal.ServerRemapDecl( to, DECL_SOUND, shaderDecl->Index() ) ); + outMsg.WriteInt( gameLocal.ServerRemapDecl( to, DECL_SOUND, shaderDecl->Index() ) ); } else { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SOUND_EVENT ); outMsg.WriteByte( evt ); @@ -3284,7 +3284,7 @@ void idMultiplayerGame::VoiceChat( const idCmdArgs &args, bool team ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_VCHAT ); - outMsg.WriteLong( index ); + outMsg.WriteInt( index ); outMsg.WriteBits( team ? 1 : 0, 1 ); networkSystem->ClientSendReliableMessage( outMsg ); } @@ -3349,7 +3349,7 @@ void idMultiplayerGame::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_STARTSTATE ); // send the game state and start time outMsg.WriteByte( gameState ); - outMsg.WriteLong( matchStartedTime ); + outMsg.WriteInt( matchStartedTime ); outMsg.WriteShort( startFragLimit ); // send the powerup states and the spectate states for( i = 0; i < gameLocal.numClients; i++ ) { @@ -3373,7 +3373,7 @@ void idMultiplayerGame::ServerWriteInitialReliableMessages( int clientNum ) { if ( gameState == COUNTDOWN ) { outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_WARMUPTIME ); - outMsg.WriteLong( warmupEndTime ); + outMsg.WriteInt( warmupEndTime ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } } diff --git a/neo/game/Player.cpp b/neo/game/Player.cpp index 35350023..987feb52 100644 --- a/neo/game/Player.cpp +++ b/neo/game/Player.cpp @@ -8165,7 +8165,7 @@ void idPlayer::WritePlayerStateToSnapshot( idBitMsgDelta &msg ) const { int i; msg.WriteByte( bobCycle ); - msg.WriteLong( stepUpTime ); + msg.WriteInt( stepUpTime ); msg.WriteFloat( stepUpDelta ); msg.WriteShort( inventory.weapons ); msg.WriteByte( inventory.armor ); diff --git a/neo/game/Projectile.cpp b/neo/game/Projectile.cpp index a0ea4b06..a459b625 100644 --- a/neo/game/Projectile.cpp +++ b/neo/game/Projectile.cpp @@ -672,7 +672,7 @@ void idProjectile::AddDefaultDamageEffect( const trace_t &collision, const idVec msg.WriteFloat( collision.c.point[1] ); msg.WriteFloat( collision.c.point[2] ); msg.WriteDir( collision.c.normal, 24 ); - msg.WriteLong( ( collision.c.material != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) : -1 ); + msg.WriteInt( ( collision.c.material != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) : -1 ); msg.WriteFloat( velocity[0], 5, 10 ); msg.WriteFloat( velocity[1], 5, 10 ); msg.WriteFloat( velocity[2], 5, 10 ); diff --git a/neo/game/Weapon.cpp b/neo/game/Weapon.cpp index 7020ca5e..f5ee3333 100644 --- a/neo/game/Weapon.cpp +++ b/neo/game/Weapon.cpp @@ -2705,7 +2705,7 @@ void idWeapon::Event_SetSkin( const char *skinname ) { byte msgBuf[MAX_EVENT_PARAM_SIZE]; msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( ( skinDecl != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_SKIN, skinDecl->Index() ) : -1 ); + msg.WriteInt( ( skinDecl != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_SKIN, skinDecl->Index() ) : -1 ); ServerSendEvent( EVENT_CHANGESKIN, &msg, false, -1 ); } } diff --git a/neo/game/physics/Physics_AF.cpp b/neo/game/physics/Physics_AF.cpp index e416a584..be991a41 100644 --- a/neo/game/physics/Physics_AF.cpp +++ b/neo/game/physics/Physics_AF.cpp @@ -7924,7 +7924,7 @@ void idPhysics_AF::WriteToSnapshot( idBitMsgDelta &msg ) const { int i; idCQuat quat; - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.noMoveTime ); msg.WriteFloat( current.activateTime ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[0], AF_VELOCITY_EXPONENT_BITS, AF_VELOCITY_MANTISSA_BITS ); diff --git a/neo/game/physics/Physics_Monster.cpp b/neo/game/physics/Physics_Monster.cpp index 1e48b7f9..f3a1606a 100644 --- a/neo/game/physics/Physics_Monster.cpp +++ b/neo/game/physics/Physics_Monster.cpp @@ -780,7 +780,7 @@ void idPhysics_Monster::WriteToSnapshot( idBitMsgDelta &msg ) const { msg.WriteDeltaFloat( 0.0f, current.pushVelocity[0], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[1], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[2], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteBits( current.onGround, 1 ); } diff --git a/neo/game/physics/Physics_Parametric.cpp b/neo/game/physics/Physics_Parametric.cpp index c502ba53..ced21a33 100644 --- a/neo/game/physics/Physics_Parametric.cpp +++ b/neo/game/physics/Physics_Parametric.cpp @@ -1031,8 +1031,8 @@ idPhysics_Parametric::WriteToSnapshot ================ */ void idPhysics_Parametric::WriteToSnapshot( idBitMsgDelta &msg ) const { - msg.WriteLong( current.time ); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.time ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.origin[0] ); msg.WriteFloat( current.origin[1] ); msg.WriteFloat( current.origin[2] ); diff --git a/neo/game/physics/Physics_RigidBody.cpp b/neo/game/physics/Physics_RigidBody.cpp index 2bd77cc0..e1990ef4 100644 --- a/neo/game/physics/Physics_RigidBody.cpp +++ b/neo/game/physics/Physics_RigidBody.cpp @@ -1466,7 +1466,7 @@ void idPhysics_RigidBody::WriteToSnapshot( idBitMsgDelta &msg ) const { quat = current.i.orientation.ToCQuat(); localQuat = current.localAxis.ToCQuat(); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.i.position[0] ); msg.WriteFloat( current.i.position[1] ); msg.WriteFloat( current.i.position[2] ); diff --git a/neo/idlib/BitMsg.h b/neo/idlib/BitMsg.h index 82edfa42..cc7cfa03 100644 --- a/neo/idlib/BitMsg.h +++ b/neo/idlib/BitMsg.h @@ -84,7 +84,7 @@ public: void WriteByte( int c ); void WriteShort( int c ); void WriteUShort( int c ); - void WriteLong( int c ); + void WriteInt( int c ); void WriteFloat( float f ); void WriteFloat( float f, int exponentBits, int mantissaBits ); void WriteAngle8( float f ); @@ -296,7 +296,7 @@ ID_INLINE void idBitMsg::WriteUShort( int c ) { WriteBits( c, 16 ); } -ID_INLINE void idBitMsg::WriteLong( int c ) { +ID_INLINE void idBitMsg::WriteInt( int c ) { WriteBits( c, 32 ); } @@ -454,7 +454,7 @@ public: void WriteByte( int c ); void WriteShort( int c ); void WriteUShort( int c ); - void WriteLong( int c ); + void WriteInt( int c ); void WriteFloat( float f ); void WriteFloat( float f, int exponentBits, int mantissaBits ); void WriteAngle8( float f ); @@ -555,7 +555,7 @@ ID_INLINE void idBitMsgDelta::WriteUShort( int c ) { WriteBits( c, 16 ); } -ID_INLINE void idBitMsgDelta::WriteLong( int c ) { +ID_INLINE void idBitMsgDelta::WriteInt( int c ) { WriteBits( c, 32 ); } diff --git a/neo/tools/debugger/DebuggerClient.cpp b/neo/tools/debugger/DebuggerClient.cpp index 04102e46..c57f9ab3 100644 --- a/neo/tools/debugger/DebuggerClient.cpp +++ b/neo/tools/debugger/DebuggerClient.cpp @@ -515,8 +515,8 @@ void rvDebuggerClient::SendAddBreakpoint ( rvDebuggerBreakpoint& bp, bool onceOn MSG_Init( &msg, buffer, sizeof( buffer ) ); MSG_WriteShort ( &msg, (int)DBMSG_ADDBREAKPOINT ); MSG_WriteBits ( &msg, onceOnly?1:0, 1 ); - MSG_WriteLong ( &msg, (unsigned long) bp.GetLineNumber ( ) ); - MSG_WriteLong ( &msg, bp.GetID ( ) ); + MSG_WriteInt ( &msg, (unsigned long) bp.GetLineNumber ( ) ); + MSG_WriteInt ( &msg, bp.GetID ( ) ); MSG_WriteString ( &msg, bp.GetFilename() ); SendPacket ( msg.data, msg.cursize ); @@ -541,7 +541,7 @@ void rvDebuggerClient::SendRemoveBreakpoint ( rvDebuggerBreakpoint& bp ) MSG_Init( &msg, buffer, sizeof( buffer ) ); MSG_WriteShort ( &msg, (int)DBMSG_REMOVEBREAKPOINT ); - MSG_WriteLong ( &msg, bp.GetID() ); + MSG_WriteInt ( &msg, bp.GetID() ); SendPacket ( msg.data, msg.cursize ); } diff --git a/neo/tools/debugger/DebuggerServer.cpp b/neo/tools/debugger/DebuggerServer.cpp index 2ad78a50..70bd0359 100644 --- a/neo/tools/debugger/DebuggerServer.cpp +++ b/neo/tools/debugger/DebuggerServer.cpp @@ -334,7 +334,7 @@ void rvDebuggerServer::MSG_WriteCallstackFunc ( msg_t* msg, const prstack_t* sta { MSG_WriteString ( msg, "" ); MSG_WriteString ( msg, "" ); - MSG_WriteLong ( msg, 0 ); + MSG_WriteInt ( msg, 0 ); return; } else @@ -351,12 +351,12 @@ void rvDebuggerServer::MSG_WriteCallstackFunc ( msg_t* msg, const prstack_t* sta OSPathToRelativePath(mBreakProgram->GetFilename( st->file ), qpath); qpath.BackSlashesToSlashes ( ); MSG_WriteString ( msg, qpath ); - MSG_WriteLong ( msg, st->linenumber ); + MSG_WriteInt ( msg, st->linenumber ); } else { MSG_WriteString ( msg, "" ); - MSG_WriteLong ( msg, 0 ); + MSG_WriteInt ( msg, 0 ); } } @@ -421,7 +421,7 @@ void rvDebuggerServer::HandleInspectThreads ( msg_t* in_msg ) idThread* thread = idThread::GetThreads()[i]; MSG_WriteString ( &msg, thread->GetThreadName ( ) ); - MSG_WriteLong ( &msg, thread->GetThreadNum ( ) ); + MSG_WriteInt ( &msg, thread->GetThreadNum ( ) ); MSG_WriteBits ( &msg, (int)(thread == mBreakInterpreter->GetThread ( )), 1 ); MSG_WriteBits ( &msg, (int)thread->IsDoneProcessing(), 1 ); @@ -619,7 +619,7 @@ void rvDebuggerServer::Break ( idInterpreter* interpreter, idProgram* program, i // Inform the debugger of the breakpoint hit MSG_Init( &msg, buffer, sizeof( buffer ) ); MSG_WriteShort ( &msg, (int)DBMSG_BREAK ); - MSG_WriteLong ( &msg, st->linenumber ); + MSG_WriteInt ( &msg, st->linenumber ); MSG_WriteString ( &msg, qpath ); SendPacket ( msg.data, msg.cursize );