Skip to content

Commit

Permalink
Merge pull request #88 from Stars-Beyond/MACRO-FIX-TEMP
Browse files Browse the repository at this point in the history
Macro fix temp
  • Loading branch information
tristanpoland authored Jul 21, 2024
2 parents 50e45ff + 68c3231 commit d397a83
Show file tree
Hide file tree
Showing 7 changed files with 4,025 additions and 4,004 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/Horizon-Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
release:
types: [published]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
REGISTRY: ghcr.io
Expand All @@ -19,40 +19,41 @@ jobs:
include:
- dockerfile: ./Dockerfile.rust
image: ghcr.io/Stars-Beyond/horizon

permissions:
contents: read
packages: write
id-token: write

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

- name: Checkout Submodules
run: git submodule update --init --recursive

- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20
with:
cosign-release: 'v2.2.4'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226

- name: Log into registry ${{ matrix.image }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934
with:
images: ${{ matrix.image }}

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
Expand All @@ -64,7 +65,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
Expand Down
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/<executable file>",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
2,002 changes: 1,001 additions & 1,001 deletions raw_points.txt

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
macro_rules! define_event {
($app:expr, $($path:expr, $handler:expr),* $(,)?) => {
$(
&$app.on($path, move || { $handler });
{
let app = &$app; // Borrow $app
let handler = $handler.clone(); //define handler within the macro's scope
app.on($path, move || { handler });
}
)*
};
}
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ fn on_connect(socket: SocketRef, Data(data): Data<Value>, players: Arc<Mutex<Vec
// systems //
/////////////////////////////////////////////////////////

//subsystems::actors::main::main();
// subsystems::core::chat::init(socket.clone());
// subsystems::actors::main::main();
subsystems::core::chat::init(socket.clone());
// subsystems::core::leaderboard::init();
// subsystems::player_data::init(socket.clone());
subsystems::core::game_logic::init();
Expand All @@ -91,9 +91,9 @@ fn on_connect(socket: SocketRef, Data(data): Data<Value>, players: Arc<Mutex<Vec
// file //
////////////////////////////////////////////////////////

define_event!(socket,
"test", events::test::main(),
);
//define_event!(socket,
// "test", events::test::main(),
// );

let players_clone = Arc::clone(&players);

Expand Down
2 changes: 1 addition & 1 deletion src/subsystems/core
Submodule core updated from 67e49c to 63a2de
Loading

0 comments on commit d397a83

Please sign in to comment.