Skip to content

Commit 2514001

Browse files
committed
Make getByteCount() functions static for fixed-size command messages
1 parent 787fcea commit 2514001

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

GeneralsMD/Code/GameEngine/Include/GameNetwork/NetCommandMsg.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class NetAckBothCommandMsg : public NetCommandMsg
111111
void setOriginalPlayerID(UnsignedByte originalPlayerID);
112112
virtual Int getSortNumber();
113113

114-
size_t getByteCount() const;
114+
static size_t getByteCount();
115115

116116
protected:
117117
UnsignedShort m_commandID;
@@ -137,7 +137,7 @@ class NetAckStage1CommandMsg : public NetCommandMsg
137137
void setOriginalPlayerID(UnsignedByte originalPlayerID);
138138
virtual Int getSortNumber();
139139

140-
size_t getByteCount() const;
140+
static size_t getByteCount();
141141

142142
protected:
143143
UnsignedShort m_commandID;
@@ -163,7 +163,7 @@ class NetAckStage2CommandMsg : public NetCommandMsg
163163
void setOriginalPlayerID(UnsignedByte originalPlayerID);
164164
virtual Int getSortNumber();
165165

166-
size_t getByteCount() const;
166+
static size_t getByteCount();
167167

168168
protected:
169169
UnsignedShort m_commandID;
@@ -181,7 +181,7 @@ class NetFrameCommandMsg : public NetCommandMsg
181181
void setCommandCount(UnsignedShort commandCount);
182182
UnsignedShort getCommandCount();
183183

184-
size_t getByteCount() const;
184+
static size_t getByteCount();
185185

186186
protected:
187187
UnsignedShort m_commandCount;
@@ -198,7 +198,7 @@ class NetPlayerLeaveCommandMsg : public NetCommandMsg
198198
UnsignedByte getLeavingPlayerID();
199199
void setLeavingPlayerID(UnsignedByte id);
200200

201-
size_t getByteCount() const;
201+
static size_t getByteCount();
202202

203203
protected:
204204
UnsignedByte m_leavingPlayerID;
@@ -217,7 +217,7 @@ class NetRunAheadMetricsCommandMsg : public NetCommandMsg
217217
Int getAverageFps();
218218
void setAverageFps(Int fps);
219219

220-
size_t getByteCount() const;
220+
static size_t getByteCount();
221221

222222
protected:
223223
Real m_averageLatency;
@@ -238,7 +238,7 @@ class NetRunAheadCommandMsg : public NetCommandMsg
238238
UnsignedByte getFrameRate();
239239
void setFrameRate(UnsignedByte frameRate);
240240

241-
size_t getByteCount() const;
241+
static size_t getByteCount();
242242

243243
protected:
244244
UnsignedShort m_runAhead;
@@ -256,7 +256,7 @@ class NetDestroyPlayerCommandMsg : public NetCommandMsg
256256
UnsignedInt getPlayerIndex();
257257
void setPlayerIndex(UnsignedInt playerIndex);
258258

259-
size_t getByteCount() const;
259+
static size_t getByteCount();
260260

261261
protected:
262262
UnsignedInt m_playerIndex;
@@ -270,7 +270,7 @@ class NetKeepAliveCommandMsg : public NetCommandMsg
270270
NetKeepAliveCommandMsg();
271271
//virtual ~NetKeepAliveCommandMsg();
272272

273-
size_t getByteCount() const;
273+
static size_t getByteCount();
274274
};
275275

276276
//-----------------------------------------------------------------------------
@@ -281,7 +281,7 @@ class NetDisconnectKeepAliveCommandMsg : public NetCommandMsg
281281
NetDisconnectKeepAliveCommandMsg();
282282
//virtual ~NetDisconnectKeepAliveCommandMsg();
283283

284-
size_t getByteCount() const;
284+
static size_t getByteCount();
285285
};
286286

287287
//-----------------------------------------------------------------------------
@@ -298,7 +298,7 @@ class NetDisconnectPlayerCommandMsg : public NetCommandMsg
298298
UnsignedInt getDisconnectFrame();
299299
void setDisconnectFrame(UnsignedInt frame);
300300

301-
size_t getByteCount() const;
301+
static size_t getByteCount();
302302

303303
protected:
304304
UnsignedByte m_disconnectSlot;
@@ -313,7 +313,7 @@ class NetPacketRouterQueryCommandMsg : public NetCommandMsg
313313
NetPacketRouterQueryCommandMsg();
314314
//virtual ~NetPacketRouterQueryCommandMsg();
315315

316-
size_t getByteCount() const;
316+
static size_t getByteCount();
317317
};
318318

319319
//-----------------------------------------------------------------------------
@@ -324,7 +324,7 @@ class NetPacketRouterAckCommandMsg : public NetCommandMsg
324324
NetPacketRouterAckCommandMsg();
325325
//virtual ~NetPacketRouterAckCommandMsg();
326326

327-
size_t getByteCount() const;
327+
static size_t getByteCount();
328328
};
329329

330330
//-----------------------------------------------------------------------------
@@ -379,7 +379,7 @@ class NetDisconnectVoteCommandMsg : public NetCommandMsg
379379
UnsignedInt getVoteFrame();
380380
void setVoteFrame(UnsignedInt voteFrame);
381381

382-
size_t getByteCount() const;
382+
static size_t getByteCount();
383383

384384
protected:
385385
UnsignedByte m_slot;
@@ -397,7 +397,7 @@ class NetProgressCommandMsg: public NetCommandMsg
397397
UnsignedByte getPercentage();
398398
void setPercentage( UnsignedByte percent );
399399

400-
size_t getByteCount() const;
400+
static size_t getByteCount();
401401
protected:
402402
UnsignedByte m_percent;
403403
};
@@ -413,7 +413,7 @@ class NetWrapperCommandMsg : public NetCommandMsg
413413
UnsignedByte * getData();
414414
void setData(UnsignedByte *data, UnsignedInt dataLength);
415415

416-
size_t getByteCount() const;
416+
static size_t getByteCount();
417417

418418
UnsignedInt getChunkNumber();
419419
void setChunkNumber(UnsignedInt chunkNumber);
@@ -513,7 +513,7 @@ class NetFileProgressCommandMsg : public NetCommandMsg
513513
Int getProgress();
514514
void setProgress(Int val);
515515

516-
size_t getByteCount() const;
516+
static size_t getByteCount();
517517

518518
protected:
519519
UnsignedShort m_fileID;
@@ -530,7 +530,7 @@ class NetDisconnectFrameCommandMsg : public NetCommandMsg
530530
UnsignedInt getDisconnectFrame();
531531
void setDisconnectFrame(UnsignedInt disconnectFrame);
532532

533-
size_t getByteCount() const;
533+
static size_t getByteCount();
534534

535535
protected:
536536
UnsignedInt m_disconnectFrame;
@@ -546,7 +546,7 @@ class NetDisconnectScreenOffCommandMsg : public NetCommandMsg
546546
UnsignedInt getNewFrame();
547547
void setNewFrame(UnsignedInt newFrame);
548548

549-
size_t getByteCount() const;
549+
static size_t getByteCount();
550550

551551
protected:
552552
UnsignedInt m_newFrame;
@@ -562,7 +562,7 @@ class NetFrameResendRequestCommandMsg : public NetCommandMsg
562562
UnsignedInt getFrameToResend();
563563
void setFrameToResend(UnsignedInt frame);
564564

565-
size_t getByteCount() const;
565+
static size_t getByteCount();
566566

567567
protected:
568568
UnsignedInt m_frameToResend;

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,35 +1178,35 @@ void NetFrameResendRequestCommandMsg::setFrameToResend(UnsignedInt frame) {
11781178
// getByteCount() implementations for fixed-size command messages
11791179
//-------------------------
11801180

1181-
size_t NetAckBothCommandMsg::getByteCount() const {
1181+
size_t NetAckBothCommandMsg::getByteCount() {
11821182
return sizeof(NetPacketAckCommand);
11831183
}
11841184

1185-
size_t NetFrameCommandMsg::getByteCount() const {
1185+
size_t NetFrameCommandMsg::getByteCount() {
11861186
return sizeof(NetPacketFrameCommand);
11871187
}
11881188

1189-
size_t NetKeepAliveCommandMsg::getByteCount() const {
1189+
size_t NetKeepAliveCommandMsg::getByteCount() {
11901190
return sizeof(NetPacketKeepAliveCommand);
11911191
}
11921192

1193-
size_t NetWrapperCommandMsg::getByteCount() const {
1193+
size_t NetWrapperCommandMsg::getByteCount() {
11941194
return sizeof(NetPacketWrapperCommand);
11951195
}
11961196

1197-
size_t NetAckStage1CommandMsg::getByteCount() const {
1197+
size_t NetAckStage1CommandMsg::getByteCount() {
11981198
return sizeof(NetPacketAckCommand);
11991199
}
12001200

1201-
size_t NetAckStage2CommandMsg::getByteCount() const {
1201+
size_t NetAckStage2CommandMsg::getByteCount() {
12021202
return sizeof(NetPacketAckCommand);
12031203
}
12041204

1205-
size_t NetPlayerLeaveCommandMsg::getByteCount() const {
1205+
size_t NetPlayerLeaveCommandMsg::getByteCount() {
12061206
return sizeof(NetPacketPlayerLeaveCommand);
12071207
}
12081208

1209-
size_t NetRunAheadMetricsCommandMsg::getByteCount() const {
1209+
size_t NetRunAheadMetricsCommandMsg::getByteCount() {
12101210
return sizeof(NetPacketRunAheadMetricsCommand);
12111211
}
12121212

0 commit comments

Comments
 (0)