Skip to content

Commit

Permalink
Cleanup|Client|Server: Whitespace style refresh (selected subdirector…
Browse files Browse the repository at this point in the history
…ies)

Use a space in `if`, `for`, etc. statements after the keyword.
This commit only contains whitespace changes.
  • Loading branch information
skyjake committed Jun 2, 2016
1 parent e82d316 commit 7ad0137
Show file tree
Hide file tree
Showing 80 changed files with 1,635 additions and 1,635 deletions.
10 changes: 5 additions & 5 deletions doomsday/apps/client/src/client/cl_frame.cpp
Expand Up @@ -115,23 +115,23 @@ void Cl_Frame2Received(int packetType)

// All frames that arrive before the first frame are ignored.
// They are most likely from the wrong map.
if(packetType == PSV_FIRST_FRAME2)
if (packetType == PSV_FIRST_FRAME2)
{
gotFirstFrame = true;
}
else if(!gotFirstFrame)
else if (!gotFirstFrame)
{
// Just ignore. If this was a legitimate frame, the server will
// send it again when it notices no ack is coming.
return;
}

// Read and process the message.
while(!Reader_AtEnd(msgReader))
while (!Reader_AtEnd(msgReader))
{
byte const deltaType = Reader_ReadByte(msgReader);

switch(deltaType)
switch (deltaType)
{
case DT_CREATE_MOBJ:
// The mobj will be created/shown.
Expand Down Expand Up @@ -180,7 +180,7 @@ void Cl_Frame2Received(int packetType)
}
}

if(!gotFrame)
if (!gotFrame)
{
LOGDEV_NET_NOTE("First frame received");
}
Expand Down
10 changes: 5 additions & 5 deletions doomsday/apps/client/src/client/cl_infine.cpp
Expand Up @@ -42,7 +42,7 @@ void Cl_Finale(Reader *msg)
int const flags = Reader_ReadByte(msg);
finaleid_t const finaleId = Reader_ReadUInt32(msg);

if(flags & FINF_SCRIPT)
if (flags & FINF_SCRIPT)
{
// Read the script into map-scope memory. It will be freed
// when the next map is loaded.
Expand All @@ -52,7 +52,7 @@ void Cl_Finale(Reader *msg)
script[len] = 0;
}

if((flags & FINF_SCRIPT) && (flags & FINF_BEGIN))
if ((flags & FINF_SCRIPT) && (flags & FINF_BEGIN))
{
// Start the script.
currentFinale = FI_Execute((const char*)script, FF_LOCAL);
Expand All @@ -63,19 +63,19 @@ void Cl_Finale(Reader *msg)
/// @todo Wouldn't hurt to make sure that the server is talking about the
/// same finale as before... (check remoteFinale)

if((flags & FINF_END) && currentFinale)
if ((flags & FINF_END) && currentFinale)
{
FI_ScriptTerminate(currentFinale);
currentFinale = 0;
remoteFinale = 0;
}

if((flags & FINF_SKIP) && currentFinale)
if ((flags & FINF_SKIP) && currentFinale)
{
FI_ScriptRequestSkip(currentFinale);
}

if(script) M_Free(script);
if (script) M_Free(script);
}

void Cl_RequestFinaleSkip()
Expand Down
56 changes: 28 additions & 28 deletions doomsday/apps/client/src/client/cl_main.cpp
Expand Up @@ -56,11 +56,11 @@ int clientPaused; // Set by the server.

void Cl_InitID()
{
if(auto arg = CommandLine::get().check("-id", 1))
if (auto arg = CommandLine::get().check("-id", 1))
{
bool ok;
auto newId = arg.params.at(0).toUInt(&ok, 0);
if(ok)
if (ok)
{
clientID = newId;
LOG_NET_NOTE("Using custom client ID: 0x%08x") << clientID;
Expand All @@ -75,7 +75,7 @@ void Cl_InitID()

auto &config = Config::get();

if(config.has(VAR_NETWORK_ID))
if (config.has(VAR_NETWORK_ID))
{
clientID = config.gets(VAR_NETWORK_ID).toUInt(nullptr, 16);
return;
Expand Down Expand Up @@ -154,7 +154,7 @@ void Cl_AnswerHandshake()
Net_SendBuffer(0, 0);

// Check the version number.
if(remoteVersion != SV_VERSION)
if (remoteVersion != SV_VERSION)
{
LOG_NET_ERROR("Version conflict! (you:%i, server:%i)")
<< SV_VERSION << remoteVersion;
Expand All @@ -166,7 +166,7 @@ void Cl_AnswerHandshake()

// Update time and player ingame status.
gameTime = remoteGameTime;
for(int i = 0; i < DDMAXPLAYERS; ++i)
for (int i = 0; i < DDMAXPLAYERS; ++i)
{
/// @todo With multiple local players, must clear only the appropriate flags.
DD_Player(i)->publicData().flags &= ~DDPF_LOCAL;
Expand All @@ -190,7 +190,7 @@ void Cl_AnswerHandshake()
netLoggedIn = false;
clientPaused = false;

if(handshakeReceived)
if (handshakeReceived)
return;

// This prevents redundant re-initialization.
Expand Down Expand Up @@ -232,7 +232,7 @@ void Cl_HandlePlayerInfo()
LOG_NET_VERBOSE("Player %i named \"%s\"") << console << name;

// Is the console number valid?
if(console >= DDMAXPLAYERS)
if (console >= DDMAXPLAYERS)
return;

player_t *plr = DD_Player(console);
Expand All @@ -241,7 +241,7 @@ void Cl_HandlePlayerInfo()

strcpy(plr->name, name);

if(!present)
if (!present)
{
// This is a new player! Let the game know about this.
gx.NetPlayerEvent(console, DDPE_ARRIVAL, 0);
Expand All @@ -260,15 +260,15 @@ void Cl_PlayerLeaves(int plrNum)
void Cl_GetPackets()
{
// All messages come from the server.
while(Net_GetPacket())
while (Net_GetPacket())
{
Msg_BeginRead();

// First check for packets that are only valid when
// a game is in progress.
if(Cl_GameReady())
if (Cl_GameReady())
{
switch(netBuffer.msg.type)
switch (netBuffer.msg.type)
{
case PSV_FIRST_FRAME2:
case PSV_FRAME2:
Expand All @@ -286,7 +286,7 @@ void Cl_GetPackets()
}

// How about the rest?
switch(netBuffer.msg.type)
switch (netBuffer.msg.type)
{
case PSV_PLAYER_FIX:
ClPlayer_HandleFix();
Expand Down Expand Up @@ -378,7 +378,7 @@ void Cl_GetPackets()
break;

default:
if(netBuffer.msg.type >= PKT_GAME_MARKER)
if (netBuffer.msg.type >= PKT_GAME_MARKER)
{
gx.HandlePacket(netBuffer.player, netBuffer.msg.type,
netBuffer.msg.data, netBuffer.length);
Expand All @@ -402,18 +402,18 @@ static void assertPlayerIsValid(int plrNum)
{
LOG_AS("Client.assertPlayerIsValid");

if(!isClient || !Cl_GameReady() || clientPaused) return;
if(plrNum < 0 || plrNum >= DDMAXPLAYERS) return;
if (!isClient || !Cl_GameReady() || clientPaused) return;
if (plrNum < 0 || plrNum >= DDMAXPLAYERS) return;

player_t *plr = DD_Player(plrNum);
clplayerstate_t *s = ClPlayer_State(plrNum);

// Must have a mobj!
if(!s->clMobjId || !plr->publicData().mo)
if (!s->clMobjId || !plr->publicData().mo)
return;

mobj_t *clmo = ClMobj_Find(s->clMobjId);
if(!clmo)
if (!clmo)
{
LOGDEV_NET_NOTE("Player %i does not have a clmobj yet [%i]") << plrNum << s->clMobjId;
return;
Expand All @@ -425,11 +425,11 @@ static void assertPlayerIsValid(int plrNum)
*/

// Make sure the flags are correctly set for a client.
if(mo->ddFlags & DDMF_REMOTE)
if (mo->ddFlags & DDMF_REMOTE)
{
LOGDEV_NET_NOTE("Player %i's mobj should not be remote") << plrNum;
}
if(clmo->ddFlags & DDMF_SOLID)
if (clmo->ddFlags & DDMF_SOLID)
{
LOGDEV_NET_NOTE("Player %i's clmobj should not be solid (when player is alive)") << plrNum;
}
Expand All @@ -439,7 +439,7 @@ static void assertPlayerIsValid(int plrNum)

void Cl_Ticker(timespan_t ticLength)
{
if(!isClient || !Cl_GameReady() || clientPaused)
if (!isClient || !Cl_GameReady() || clientPaused)
return;

// On clientside, players are represented by two mobjs: the real mobj,
Expand All @@ -448,13 +448,13 @@ void Cl_Ticker(timespan_t ticLength)
// the changes from the server) to match the changes. The game ticker
// has already been run when Cl_Ticker() is called, so let's update the
// player's clmobj to its updated state.
for(int i = 0; i < DDMAXPLAYERS; ++i)
for (int i = 0; i < DDMAXPLAYERS; ++i)
{
if(!DD_Player(i)->publicData().inGame) continue;
if (!DD_Player(i)->publicData().inGame) continue;

if(i != consolePlayer)
if (i != consolePlayer)
{
if(DD_Player(i)->publicData().mo)
if (DD_Player(i)->publicData().mo)
{
Smoother_AddPos(DD_Player(i)->smoother(),
Cl_FrameGameTime(),
Expand All @@ -476,7 +476,7 @@ void Cl_Ticker(timespan_t ticLength)
#endif
}

if(App_World().hasMap())
if (App_World().hasMap())
{
App_World().map().expireClMobjs();
}
Expand All @@ -490,16 +490,16 @@ D_CMD(Login)
DENG2_UNUSED(src);

// Only clients can log in.
if(!isClient)
if (!isClient)
return false;

Msg_Begin(PKT_LOGIN);
// Write the password.
if(argc == 1)
if (argc == 1)
{
Writer_WriteByte(msgWriter, 0); // No password given!
}
else if(strlen(argv[1]) <= 255)
else if (strlen(argv[1]) <= 255)
{
Writer_WriteByte(msgWriter, strlen(argv[1]));
Writer_Write(msgWriter, argv[1], strlen(argv[1]));
Expand Down

0 comments on commit 7ad0137

Please sign in to comment.