Page MenuHomeWildfire Games

Split CNetFileTransferer::HandleMessageReceive into one function per case
Needs ReviewPublic

Authored by elexis on Jun 7 2018, 1:02 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Trac Tickets
#5212
Summary

Split this for good practice, making it a bit easier to read and maintain.

Test Plan

Notice the code didn't change. Could use an FSM model eventually.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6232
Build 10352: Vulcan BuildJenkins
Build 10351: arc lint + arc unit

Event Timeline

elexis created this revision.Jun 7 2018, 1:02 AM
Vulcan added a subscriber: Vulcan.Jun 7 2018, 3:00 AM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/differential/636/display/redirect

vladislavbelov added inline comments.
source/network/NetFileTransfer.cpp
29

I think this place is good for switch.

43

static_cast here and below.

106

It'd be good to describe why exactly 0.5, and probably add a constant name.

elexis added inline comments.Jun 10 2018, 6:19 PM
source/network/NetFileTransfer.cpp
29

So you disagree with the idea of this patch? I think we could move all the NetClient and NetServer functions into a single switch statement too.

106

Or implementing the TODO

elexis added inline comments.Jun 10 2018, 6:22 PM
source/network/NetFileTransfer.cpp
29

Sorry, didn't comprehend what you meant.

Preferably it should become an FSM but here we can use the switch indeed