Skip to content

Commit

Permalink
Add server basic architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
Saverio976 committed Nov 12, 2024
1 parent 35c992b commit 27edc07
Show file tree
Hide file tree
Showing 31 changed files with 1,142 additions and 28 deletions.
106 changes: 79 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
echo "release_tag=0.0.0" >> $GITHUB_OUTPUT
fi
# ----------------------------------------------------------------------------
# -------------------------- TO TAR
# ----------------------------------------------------------------------------

date-to-tar:
runs-on: ubuntu-latest
needs: release-create
Expand Down Expand Up @@ -66,12 +70,12 @@ jobs:
run: |
gh release upload ${{ needs.release-create.outputs.release }} ./date.tar
- name: Upload To Artifact
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: date.tar
path: ./date.tar
# - name: Upload To Artifact
# if: github.ref != 'refs/heads/main'
# uses: actions/upload-artifact@v3
# with:
# name: date.tar
# path: ./date.tar

enet-to-tar:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -101,12 +105,12 @@ jobs:
run: |
gh release upload ${{ needs.release-create.outputs.release }} ./enet.tar
- name: Upload To Artifact
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: enet.tar
path: ./enet.tar
# - name: Upload To Artifact
# if: github.ref != 'refs/heads/main'
# uses: actions/upload-artifact@v3
# with:
# name: enet.tar
# path: ./enet.tar

raylib-to-tar:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -137,12 +141,12 @@ jobs:
run: |
gh release upload ${{ needs.release-create.outputs.release }} ./raylib.tar
- name: Upload To Artifact
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: raylib.tar
path: ./raylib.tar
# - name: Upload To Artifact
# if: github.ref != 'refs/heads/main'
# uses: actions/upload-artifact@v3
# with:
# name: raylib.tar
# path: ./raylib.tar

raylibcpp-to-tar:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -173,16 +177,20 @@ jobs:
run: |
gh release upload ${{ needs.release-create.outputs.release }} ./raylib-cpp.tar
- name: Upload To Artifact
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: raylib-cpp.tar
path: ./raylib-cpp.tar
# - name: Upload To Artifact
# if: github.ref != 'refs/heads/main'
# uses: actions/upload-artifact@v3
# with:
# name: raylib-cpp.tar
# path: ./raylib-cpp.tar

# ----------------------------------------------------------------------------
# -------------------------- BINARY CLIENT
# ----------------------------------------------------------------------------

release-client-windows:
runs-on: windows-latest
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar]
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar, enet-to-tar]

steps:
- name: Checkout
Expand Down Expand Up @@ -227,7 +235,7 @@ jobs:

release-client-linux:
runs-on: ubuntu-latest
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar]
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar, enet-to-tar]

steps:
- name: Checkout
Expand Down Expand Up @@ -267,7 +275,7 @@ jobs:

release-client-macos:
runs-on: macos-latest
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar]
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar, enet-to-tar]

steps:
- name: Checkout
Expand Down Expand Up @@ -304,3 +312,47 @@ jobs:
with:
name: Colomb-macos.zip
path: ./client/Colomb-macos.zip

# ----------------------------------------------------------------------------
# -------------------------- BINARY SERVER
# ----------------------------------------------------------------------------

release-server-linux:
runs-on: ubuntu-latest
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar, enet-to-tar]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
cd server
sudo ./scripts/install-deps-linux.sh
- name: Build
run: |
cd server
./scripts/bundle-linux.sh
- name: Upload To Release
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.release-create.outputs.release }} ./client/Colomb_server-linux.tar.gz
gh release upload ${{ needs.release-create.outputs.release }} ./client/Colomb_server-linux.sh
- name: Upload To Artifact
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: Colomb_server-linux.tar.gz
path: ./client/Colomb_server-linux.tar.gz

- name: Upload To Artifact
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: Colomb_server-linux.sh
path: ./client/Colomb_server-linux.sh
2 changes: 1 addition & 1 deletion client/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Colomb
# Colomb Client
A game
100 changes: 100 additions & 0 deletions server/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
Language: Cpp
ColumnLimit: '108'
ReflowComments: true
AlignAfterOpenBracket: AlwaysBreak
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
EmptyLineBeforeAccessModifier: Always
IndentWrappedFunctionNames: 'false'
AccessModifierOffset: 0
IndentAccessModifiers: true
BinPackParameters: false
BinPackArguments: false
InsertTrailingCommas: Wrapped
PackConstructorInitializers: CurrentLine
AlwaysBreakTemplateDeclarations: Yes
DerivePointerAlignment: true
LambdaBodyIndentation: Signature
AlignOperands: false
BreakBeforeBraces: Custom

BraceWrapping:
AfterCaseLabel: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: true
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true

AlwaysBreakAfterReturnType: None

TabWidth: '4'
UseTab: Never
IndentPPDirectives: BeforeHash
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignArrayOfStructures: 'Left'
Cpp11BracedListStyle: true
PointerAlignment: Right
ReferenceAlignment: Right
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: 'false'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: 'false'
SpacesInAngles: false
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
SpacesInContainerLiterals: 'false'
SpaceAfterTemplateKeyword: 'true'
IndentCaseLabels: 'true'
NamespaceIndentation: All
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: 'false'
AllowShortBlocksOnASingleLine: 'true'
AllowShortCaseLabelsOnASingleLine: 'true'
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
AlignTrailingComments: true
BreakStringLiterals: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
SortIncludes: true
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '<.+>' # System/Standard libs
Priority: 1
- Regex: '"raylib.h"' # Criterion headers
Priority: 2
- Regex: '"raylib-cpp.hpp"' # Criterion headers
Priority: 2
- Regex: '".+"' # Any "my_header.h"
Priority: 3

# Sort 'using' declarations
SortUsingDeclarations: true

BasedOnStyle: LLVM
AlwaysBreakBeforeMultilineStrings: 'true'
ContinuationIndentWidth: '4'
SpaceInEmptyBlock: true
IndentWidth: '4'
PenaltyBreakAssignment: '0'
SpaceBeforeCpp11BracedList: 'true'
SpaceBeforeRangeBasedForLoopColon: 'true'

# To totally disable format
DisableFormat: 'false'
5 changes: 5 additions & 0 deletions server/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Checks: '-*,clang-diagnostic-*,clang-analyzer-*,-*,clang-analyzer-*,concurrency-*,cppcoreguidelines-*,modernize-*,portability-*,readability-*,-readability-identifier-length,-modernize-use-trailing-return-type'
WarningsAsErrors: '-*,clang-diagnostic-*,clang-analyzer-*,-*,clang-analyzer-*,concurrency-*,cppcoreguidelines-*,modernize-*,portability-*,readability-*,-readability-identifier-length,-modernize-use-trailing-return-type'
HeaderFilterRegex: '(src/ECS/)|(src/Client/)|(src/Server/)|(src/Nitwork/)'
AnalyzeTemporaryDtors: false
3 changes: 3 additions & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.cache/
/build
/Colomb_server
Loading

0 comments on commit 27edc07

Please sign in to comment.