Opened 6 years ago

Last modified 5 years ago

#5212 new defect

Small networking code refactoring

Reported by: elexis Owned by:
Priority: Nice to Have Milestone: Backlog
Component: Network Keywords:
Cc: Patch: Phab:D1567

Description

  • Similar to Phab:D16, NetSession.cpp should be split to NetServerSession.cpp and NetClientSession.cpp.
  • CNetFileTransferer::HandleMessageReceive should be split into one function per case.
  • CNetFileTransferer might want to inherit an FSM too.

Change History (2)

comment:1 by elexis, 6 years ago

Patch: Phab:D1567

comment:2 by elexis, 5 years ago

In 22916:

Split NetFileTransfer message parsing into one function per case, refs #5212.

Avoid redundant map lookups by caching the iterator.
Remove c-style casts by using type specific printf parameters, and static_cast elsewhere.
Use references while at it, and typedef -> using.

Differential Revision: https://code.wildfiregames.com/D1567
Comments by: Vladislav
Tested on: clang 8.0.1, gcc 9.1.0

Note: See TracTickets for help on using tickets.