Skip to content

Commit 238fc7e

Browse files
committed
nit: remove superfluous indent, restore some comments, make other comments more consistent
1 parent ba6335d commit 238fc7e

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

GeneralsMD/Code/GameEngine/Source/GameNetwork/NetPacket.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,10 @@ UnsignedInt NetPacket::GetGameCommandSize(NetCommandMsg *msg) {
364364

365365
msglen += sizeof(GameMessage::Type);
366366
msglen += sizeof(UnsignedByte);
367-
367+
368368
GameMessageParserArgumentType *arg = parser->getFirstArgumentType();
369369
while (arg != NULL) {
370-
msglen += 2 * sizeof(UnsignedByte); // type and count
370+
msglen += 2 * sizeof(UnsignedByte); // for the type and number of args of that type declaration.
371371
GameMessageArgumentDataType type = arg->getType();
372372

373373
switch (type) {
@@ -498,17 +498,17 @@ UnsignedInt NetPacket::GetWrapperCommandSize(NetCommandMsg *msg) {
498498
UnsignedInt NetPacket::GetFileCommandSize(NetCommandMsg *msg) {
499499
NetFileCommandMsg *filemsg = (NetFileCommandMsg *)msg;
500500
return sizeof(NetPacketFileCommandHeader)
501-
+ filemsg->getPortableFilename().getLength() + 1 // filename + null terminator
502-
+ sizeof(UnsignedInt) // file data length field
503-
+ filemsg->getFileLength(); // actual file data
501+
+ filemsg->getPortableFilename().getLength() + 1 // PORTABLE filename and the terminating 0
502+
+ sizeof(UnsignedInt) // file data length
503+
+ filemsg->getFileLength(); // the file data
504504
}
505505

506506
UnsignedInt NetPacket::GetFileAnnounceCommandSize(NetCommandMsg *msg) {
507507
NetFileAnnounceCommandMsg *filemsg = (NetFileAnnounceCommandMsg *)msg;
508508
return sizeof(NetPacketFileAnnounceCommandHeader)
509-
+ filemsg->getPortableFilename().getLength() + 1 // filename + null terminator
510-
+ sizeof(UnsignedShort) // file ID
511-
+ sizeof(UnsignedByte); // player mask
509+
+ filemsg->getPortableFilename().getLength() + 1 // PORTABLE filename and the terminating 0
510+
+ sizeof(UnsignedShort) // m_fileID
511+
+ sizeof(UnsignedByte); // m_playerMask
512512
}
513513

514514
UnsignedInt NetPacket::GetFileProgressCommandSize(NetCommandMsg *msg) {
@@ -2278,7 +2278,7 @@ Bool NetPacket::isRoomForFileMessage(NetCommandRef *msg) {
22782278
len += sizeof(UnsignedByte) + sizeof(UnsignedShort);
22792279
}
22802280

2281-
++len; // NetPacketFieldTypes::Data
2281+
++len; // for NetPacketFieldTypes::Data
22822282
len += cmdMsg->getPortableFilename().getLength() + 1; // PORTABLE filename + the terminating 0
22832283
len += sizeof(UnsignedInt); // filedata length
22842284
len += cmdMsg->getFileLength();
@@ -2385,7 +2385,7 @@ Bool NetPacket::isRoomForFileAnnounceMessage(NetCommandRef *msg) {
23852385
len += sizeof(UnsignedByte) + sizeof(UnsignedShort);
23862386
}
23872387

2388-
++len; // NetPacketFieldTypes::Data
2388+
++len; // for NetPacketFieldTypes::Data
23892389
len += cmdMsg->getPortableFilename().getLength() + 1; // PORTABLE filename + the terminating 0
23902390
len += sizeof(UnsignedShort); // m_fileID
23912391
len += sizeof(UnsignedByte); // m_playerMask
@@ -2485,7 +2485,7 @@ Bool NetPacket::isRoomForFileProgressMessage(NetCommandRef *msg) {
24852485
len += sizeof(UnsignedByte) + sizeof(UnsignedShort);
24862486
}
24872487

2488-
++len; // NetPacketFieldTypes::Data
2488+
++len; // for NetPacketFieldTypes::Data
24892489
len += sizeof(UnsignedShort); // m_fileID
24902490
len += sizeof(Int); // m_progress
24912491

@@ -2615,7 +2615,7 @@ Bool NetPacket::isRoomForWrapperMessage(NetCommandRef *msg) {
26152615
len += sizeof(UnsignedByte) + sizeof(UnsignedShort);
26162616
}
26172617

2618-
++len; // NetPacketFieldTypes::Data
2618+
++len; // for NetPacketFieldTypes::Data
26192619
len += sizeof(UnsignedShort); // wrapped command ID
26202620
len += sizeof(UnsignedInt); // chunk number
26212621
len += sizeof(UnsignedInt); // number of chunks
@@ -2714,7 +2714,7 @@ Bool NetPacket::isRoomForTimeOutGameStartMessage(NetCommandRef *msg) {
27142714
len += sizeof(UnsignedByte);
27152715
}
27162716

2717-
++len; // For the NetPacketFieldTypes::Data
2717+
++len; // for NetPacketFieldTypes::Data
27182718
if ((len + m_packetLen) > MAX_PACKET_SIZE) {
27192719
return FALSE;
27202720
}
@@ -2806,7 +2806,7 @@ Bool NetPacket::isRoomForLoadCompleteMessage(NetCommandRef *msg) {
28062806
len += sizeof(UnsignedByte);
28072807
}
28082808

2809-
++len; // For the NetPacketFieldTypes::Data
2809+
++len; // for NetPacketFieldTypes::Data
28102810
if ((len + m_packetLen) > MAX_PACKET_SIZE) {
28112811
return FALSE;
28122812
}
@@ -2890,7 +2890,7 @@ Bool NetPacket::isRoomForProgressMessage(NetCommandRef *msg) {
28902890
len += sizeof(UnsignedByte);
28912891
}
28922892

2893-
++len; // For the NetPacketFieldTypes::Data
2893+
++len; // for NetPacketFieldTypes::Data
28942894
++len; // percentage
28952895
if ((len + m_packetLen) > MAX_PACKET_SIZE) {
28962896
return FALSE;
@@ -3001,7 +3001,7 @@ Bool NetPacket::isRoomForDisconnectVoteMessage(NetCommandRef *msg) {
30013001
len += sizeof(UnsignedShort) + sizeof(UnsignedByte);
30023002
}
30033003

3004-
++len; // the NetPacketFieldTypes::Data
3004+
++len; // for NetPacketFieldTypes::Data
30053005
len += sizeof(UnsignedByte); // slot number
30063006
len += sizeof(UnsignedInt); // vote frame
30073007

@@ -3090,7 +3090,7 @@ Bool NetPacket::isRoomForDisconnectChatMessage(NetCommandRef *msg) {
30903090
len += sizeof(UnsignedByte);
30913091
}
30923092

3093-
++len; // the NetPacketFieldTypes::Data
3093+
++len; // for NetPacketFieldTypes::Data
30943094
len += sizeof(UnsignedByte); // string length
30953095
UnsignedByte textLen = cmdMsg->getText().getLength();
30963096
len += textLen * sizeof(UnsignedShort);
@@ -3213,7 +3213,7 @@ Bool NetPacket::isRoomForChatMessage(NetCommandRef *msg) {
32133213
len += sizeof(UnsignedShort) + sizeof(UnsignedByte);
32143214
}
32153215

3216-
++len; // the NetPacketFieldTypes::Data
3216+
++len; // for NetPacketFieldTypes::Data
32173217
len += sizeof(UnsignedByte); // string length
32183218
UnsignedByte textLen = cmdMsg->getText().getLength();
32193219
len += textLen * sizeof(UnsignedShort);
@@ -3297,7 +3297,7 @@ Bool NetPacket::isRoomForPacketRouterAckMessage(NetCommandRef *msg) {
32973297
len += sizeof(UnsignedByte);
32983298
}
32993299

3300-
++len; // the NetPacketFieldTypes::Data
3300+
++len; // for NetPacketFieldTypes::Data
33013301
if ((len + m_packetLen) > MAX_PACKET_SIZE) {
33023302
return FALSE;
33033303
}
@@ -3377,7 +3377,7 @@ Bool NetPacket::isRoomForPacketRouterQueryMessage(NetCommandRef *msg) {
33773377
len += sizeof(UnsignedByte);
33783378
}
33793379

3380-
++len; // the NetPacketFieldTypes::Data
3380+
++len; // for NetPacketFieldTypes::Data
33813381
if ((len + m_packetLen) > MAX_PACKET_SIZE) {
33823382
return FALSE;
33833383
}
@@ -3485,7 +3485,7 @@ Bool NetPacket::isRoomForDisconnectPlayerMessage(NetCommandRef *msg) {
34853485
len += sizeof(UnsignedShort) + sizeof(UnsignedByte);
34863486
}
34873487

3488-
++len; // the NetPacketFieldTypes::Data
3488+
++len; // for NetPacketFieldTypes::Data
34893489
len += sizeof(UnsignedByte); // slot number
34903490
len += sizeof(UnsignedInt); // disconnectFrame
34913491
if ((len + m_packetLen) > MAX_PACKET_SIZE) {
@@ -3566,7 +3566,7 @@ Bool NetPacket::isRoomForDisconnectKeepAliveMessage(NetCommandRef *msg) {
35663566
len += sizeof(UnsignedByte);
35673567
}
35683568

3569-
++len; // For the NetPacketFieldTypes::Data
3569+
++len; // for NetPacketFieldTypes::Data
35703570
if ((len + m_packetLen) > MAX_PACKET_SIZE) {
35713571
return FALSE;
35723572
}
@@ -3644,7 +3644,7 @@ Bool NetPacket::isRoomForKeepAliveMessage(NetCommandRef *msg) {
36443644
len += sizeof(UnsignedByte);
36453645
}
36463646

3647-
++len; // For the NetPacketFieldTypes::Data
3647+
++len; // for NetPacketFieldTypes::Data
36483648
if ((len + m_packetLen) > MAX_PACKET_SIZE) {
36493649
return FALSE;
36503650
}
@@ -3993,7 +3993,7 @@ Bool NetPacket::isRoomForRunAheadMetricsMessage(NetCommandRef *msg) {
39933993
len += sizeof(UnsignedShort) + sizeof(UnsignedByte);
39943994
}
39953995

3996-
++len; // NetPacketFieldTypes::Data
3996+
++len; // for NetPacketFieldTypes::Data
39973997
len += sizeof(UnsignedShort);
39983998
len += sizeof(Real);
39993999
if ((len + m_packetLen) > MAX_PACKET_SIZE) {

0 commit comments

Comments
 (0)