Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: split server and inputs into their own groups #2594

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Hazer
Copy link
Member

@Hazer Hazer commented May 27, 2024

Description

Breaking the project in smaller pieces will make the project easier to contribute and maintain in the future, it's not a major rewrite, just moving files or splitting a single file into many without major refactors.

Moves the following files to the server folder:

confighttp.cpp
confighttp.h
crypto.cpp
crypto.h
httpcommon.cpp
httpcommon.h
network.cpp
network.h
nvhttp.cpp
nvhttp.h
rtsp.cpp
rtsp.h
upnp.cpp
upnp.h

Moves the following input to the input folder and split it into:

common.cpp
common.h
gamepad.cpp
gamepad.h
init.h
keyboard.cpp
keyboard.h
mouse.cpp
mouse.h
pen.cpp
pen.h
processor.cpp
processor.h
touch.cpp
touch.h

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

Copy link

codecov bot commented May 27, 2024

Codecov Report

Attention: Patch coverage is 1.48402% with 863 lines in your changes missing coverage. Please review.

Project coverage is 10.70%. Comparing base (f9c885a) to head (49aa9d7).

Files Patch % Lines
src/input/gamepad.cpp 0.42% 213 Missing and 21 partials ⚠️
src/input/processor.cpp 0.00% 160 Missing and 5 partials ⚠️
src/input/mouse.cpp 1.40% 127 Missing and 13 partials ⚠️
src/input/keyboard.cpp 0.77% 122 Missing and 6 partials ⚠️
src/input/touch.cpp 2.56% 72 Missing and 4 partials ⚠️
src/input/pen.cpp 3.12% 58 Missing and 4 partials ⚠️
src/input/common.cpp 0.00% 15 Missing ⚠️
src/input/processor.h 0.00% 12 Missing ⚠️
src/server/confighttp.cpp 8.33% 0 Missing and 11 partials ⚠️
src/input/gamepad.h 0.00% 7 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2594      +/-   ##
==========================================
+ Coverage    9.69%   10.70%   +1.00%     
==========================================
  Files          97       87      -10     
  Lines       17524    12765    -4759     
  Branches     8204     6180    -2024     
==========================================
- Hits         1699     1366     -333     
+ Misses      13050    10328    -2722     
+ Partials     2775     1071    -1704     
Flag Coverage Δ
Linux 7.21% <0.51%> (+<0.01%) ⬆️
Windows ?
macOS-12 10.38% <1.37%> (+0.02%) ⬆️
macOS-13 10.29% <1.37%> (+0.02%) ⬆️
macOS-14 10.61% <1.37%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/audio.h 0.00% <ø> (ø)
src/config.cpp 5.13% <ø> (+0.24%) ⬆️
src/entry_handler.cpp 8.57% <ø> (+6.09%) ⬆️
src/platform/linux/publish.cpp 0.00% <ø> (ø)
src/platform/macos/input.cpp 36.57% <ø> (ø)
src/platform/macos/publish.cpp 5.12% <ø> (-2.57%) ⬇️
src/process.cpp 1.67% <ø> (+0.03%) ⬆️
src/process.h 12.50% <ø> (+1.38%) ⬆️
src/server/crypto.h 0.00% <ø> (ø)
src/server/httpcommon.cpp 23.88% <ø> (ø)
... and 24 more

... and 37 files with indirect coverage changes

@Hazer Hazer force-pushed the refactor/server-input-packages branch from 91f5661 to de943f3 Compare May 31, 2024 00:06
@Hazer Hazer marked this pull request as ready for review May 31, 2024 04:51
docs/source/source_code/source_code.rst Outdated Show resolved Hide resolved
src/input/platform_input.cpp Outdated Show resolved Hide resolved
cmake/compile_definitions/common.cmake Outdated Show resolved Hide resolved
Copy link
Member

@ReenigneArcher ReenigneArcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is touching every source file in the project, maybe it's a good opportunity to take care of this as well? #2186

@Hazer
Copy link
Member Author

Hazer commented May 31, 2024

Since this is touching every source file in the project, maybe it's a good opportunity to take care of this as well? #2186

@ReenigneArcher I was trying to avoid as much conflict as possible, but can be done, or in a future PR too. Can we force the rules to be different only for /input and /server subfolders? This way I could start migrating piece by piece

@Hazer Hazer force-pushed the refactor/server-input-packages branch 5 times, most recently from 098210f to 2f169db Compare June 1, 2024 17:22
@Hazer Hazer requested a review from ReenigneArcher June 5, 2024 20:27
@Hazer Hazer force-pushed the refactor/server-input-packages branch 2 times, most recently from 3250336 to 0425cc5 Compare June 11, 2024 23:58
@Hazer Hazer force-pushed the refactor/server-input-packages branch 3 times, most recently from 5188aa1 to 5e1d3b1 Compare June 21, 2024 00:27
@ReenigneArcher
Copy link
Member

Due to recent changes to the docs, all the doc changes can be dropped from this PR.

@Hazer Hazer force-pushed the refactor/server-input-packages branch 4 times, most recently from 4410c61 to bbd3287 Compare June 28, 2024 12:41
src/input/keyboard.cpp Outdated Show resolved Hide resolved
src/input/keyboard.cpp Outdated Show resolved Hide resolved
src/input/keyboard.h Outdated Show resolved Hide resolved
src/input/mouse.cpp Outdated Show resolved Hide resolved
src/input/mouse.h Outdated Show resolved Hide resolved
src/input/platform_input.h Show resolved Hide resolved
src/input/processor.cpp Outdated Show resolved Hide resolved
src/server/confighttp.cpp Outdated Show resolved Hide resolved
src/server/httpcommon.cpp Outdated Show resolved Hide resolved
@ReenigneArcher ReenigneArcher force-pushed the refactor/server-input-packages branch 2 times, most recently from 690939e to 0e4cc2c Compare June 28, 2024 14:45
@Hazer Hazer force-pushed the refactor/server-input-packages branch 3 times, most recently from f385a5b to 1aca214 Compare July 4, 2024 18:18
@Hazer Hazer requested a review from ReenigneArcher July 4, 2024 18:18
@Hazer Hazer force-pushed the refactor/server-input-packages branch 2 times, most recently from 724d535 to ef923da Compare July 14, 2024 00:04
@Hazer Hazer force-pushed the refactor/server-input-packages branch 2 times, most recently from 0c50c78 to a329d9f Compare August 8, 2024 23:42
Hazer added 2 commits August 11, 2024 20:40
chore: fix weird imports

chore: fix sys tray import error

chore: fix clang code style

refactor: mouse, keyboard and touch now on their own namespaces

fix: make platf_input a singleton

refactor: better isolation

lint: remove import and space

lint: import order

docs: refactor docs too

lint: new line at the end

build: glob linking input/server

build: full src glob

chore: rebase fixes

chore: revert doc changes

docs(src): apply new patterns from LizardByte#2763

chore: fixes from code review
@Hazer Hazer force-pushed the refactor/server-input-packages branch from a329d9f to 49aa9d7 Compare August 11, 2024 23:40
Copy link

sonarcloud bot commented Aug 11, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
10 Security Hotspots
D Security Rating on New Code (required ≥ A)
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants