Skip to content

Commit

Permalink
Cleanup change for linux & GH:A version bumps (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
TeddiO authored Nov 10, 2024
1 parent 61ae0c1 commit 82e363f
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 51 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@ env:
jobs:

fetch-dependencies:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
env:
STEAMWORKS_URL: ${{ secrets.STEAMWORKS_SDK_URL }}
steps:
- run: |
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-windows.zip -qO- | busybox unzip -
wget $STEAMWORKS_URL -qO- | busybox unzip -
apt-get update && apt-get install -y unzip
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-windows.zip -qO- | unzip -
wget $STEAMWORKS_URL -qO- | unzip -
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-linux.tar.gz -qO- | tar zxf -
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: premake-persistence
path: ./premake*

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: sdk-persistence-32
path: ./sdk*
Expand All @@ -41,7 +42,7 @@ jobs:
rm -R ./sdk
wget $STEAMWORKS_SDK_URL_150 -qO- | busybox unzip -
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: sdk-persistence-64
path: ./sdk*
Expand All @@ -56,28 +57,27 @@ jobs:
arch: [32, 64]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: facepunch/gmod-module-base
ref: refs/heads/development
path: gmodheaders

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
path: gfwens

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: premake-persistence
path: gfwens

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: sdk-persistence-64
path: gfwens/deps

- uses: microsoft/[email protected]

- uses: microsoft/setup-msbuild@v2
# Dumb way of doing this but oh well. Saves fight premake on this.
- name: "Compile Binary"
if: ${{ matrix.arch == 64 }}
Expand All @@ -93,37 +93,37 @@ jobs:
./premake5.exe vs2019
MSBuild.exe /p:Configuration=Release
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: gmsv_fwens_win${{matrix.arch}}.dll
path: gfwens\bin\release\gmsv_fwens_win${{matrix.arch}}.dll
###

build-linux:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
needs: fetch-dependencies

strategy:
matrix:
arch: [32, 64]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: facepunch/gmod-module-base
ref: refs/heads/development
path: gmodheaders

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
path: gfwens

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: premake-persistence
path: gfwens

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: sdk-persistence-64
path: gfwens/deps
Expand All @@ -136,40 +136,40 @@ jobs:
./premake5 gmake2
make config=release_x${{matrix.arch}}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: ${{ matrix.arch != 64 }}
with:
name: gmsv_fwens_linux.dll
path: gfwens/bin/release/gmsv_fwens_linux.dll

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: ${{ matrix.arch == 64 }}
with:
name: gmsv_fwens_linux${{matrix.arch}}.dll
path: gfwens/bin/release/gmsv_fwens_linux${{matrix.arch}}.dll

release:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
needs: [build-win, build-linux]

steps:
- name: Get short hash
id: gensha
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: gmsv_fwens_linux.dll

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: gmsv_fwens_linux64.dll

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: gmsv_fwens_win32.dll

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: gmsv_fwens_win64.dll

Expand All @@ -180,7 +180,7 @@ jobs:
tag: ${{ steps.gensha.outputs.sha8 }}
omitBody: true

- uses: geekyeggo/delete-artifact@v1
- uses: geekyeggo/delete-artifact@v5
with:
name: |
gmsv_fwens_win32.dll
Expand Down
33 changes: 17 additions & 16 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ env:

jobs:
fetch-dependencies:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

env:
STEAMWORKS_URL: ${{ secrets.STEAMWORKS_SDK_URL }}
STEAMWORKS_SDK_URL_150: ${{ secrets.STEAMWORKS_SDK_URL_150 }}
Expand All @@ -24,12 +25,12 @@ jobs:
wget $STEAMWORKS_URL -qO- | busybox unzip -
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-linux.tar.gz -qO- | tar zxf -
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: premake-persistence
path: ./premake*

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: sdk-persistence-32
path: ./sdk*
Expand All @@ -39,7 +40,7 @@ jobs:
rm -R ./sdk
wget $STEAMWORKS_SDK_URL_150 -qO- | busybox unzip -
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: sdk-persistence-64
path: ./sdk*
Expand All @@ -55,27 +56,27 @@ jobs:
arch: [32, 64]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: facepunch/gmod-module-base
ref: refs/heads/development
path: gmodheaders

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
path: gfwens

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: premake-persistence
path: gfwens

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: sdk-persistence-64
path: gfwens/deps

- uses: microsoft/setup-msbuild@v1.0.2
- uses: microsoft/setup-msbuild@v2

# Dumb way of doing this but oh well. Saves fight premake on this.
- name: "Compile Binary"
Expand All @@ -94,30 +95,30 @@ jobs:
###

build-linux:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
needs: fetch-dependencies

strategy:
matrix:
arch: [32, 64]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: facepunch/gmod-module-base
ref: refs/heads/development
path: gmodheaders

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
path: gfwens

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: premake-persistence
path: gfwens

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: sdk-persistence-64
path: gfwens/deps
Expand All @@ -132,12 +133,12 @@ jobs:
release:
name: Build Cleanup
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
if: always()
needs: [build-linux, build-win]

steps:
- uses: geekyeggo/delete-artifact@v1
- uses: geekyeggo/delete-artifact@v5
with:
name: |
premake-persistence
Expand Down
15 changes: 7 additions & 8 deletions src/fwens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void Fwens::ClearSteamContext()

void Fwens::Steam_HandleSteamConnected(SteamServersConnected_t* result)
{
if (!GetSteamContextActive())
if (!GetSteamContextActive())
{
InitSteamAPIConnection();
return;
Expand All @@ -69,11 +69,10 @@ void Fwens::NotifyLuaSteamConnectionEvent(bool connected)
LUA->PushBool(connected);

int returnValue = LUA->PCall(2, 0, 0);
if (returnValue != 0)
if (returnValue != 0)
{
LUA->Remove(1);
LUA->Remove(1);

LUA->PushSpecial(GarrysMod::Lua::SPECIAL_GLOB);
LUA->GetField(-1, "ErrorNoHalt");
LUA->Push(-3);
Expand All @@ -93,7 +92,7 @@ void Fwens::Steam_HandleOnDisconnect(SteamServersDisconnected_t* result)
void Fwens::Steam_HandleConnectionFailed(SteamServerConnectFailure_t* result)
{
steamContext_active = false;
if (!result->m_bStillRetrying)
if (!result->m_bStillRetrying)
{
ClearSteamContext();
InitSteamAPIConnection();
Expand Down Expand Up @@ -128,7 +127,7 @@ void Fwens::Steam_HandleGroupRequest(GSClientGroupStatus_t* pCallback)

snprintf(userBuffer, sizeof(userBuffer), "%llu", pCallback->m_SteamIDUser.ConvertToUint64());
snprintf(groupBuffer, sizeof(groupBuffer), "%llu", pCallback->m_SteamIDGroup.ConvertToUint64());

LUA->PushSpecial(GarrysMod::Lua::SPECIAL_GLOB);
LUA->GetField(-1, "hook");
LUA->GetField(-1, "Run");
Expand All @@ -148,12 +147,12 @@ void Fwens::Steam_HandleGroupRequest(GSClientGroupStatus_t* pCallback)
LUA->SetField(-2, "groupID64");

int returnValue = LUA->PCall(2, 0, 0);
if (returnValue != 0)
if (returnValue != 0)
{
// Dump our two current tables to simplify this. Can't pop because LIFO.
LUA->Remove(1);
LUA->Remove(1);

LUA->PushSpecial(GarrysMod::Lua::SPECIAL_GLOB);
LUA->GetField(-1, "ErrorNoHalt");
LUA->Push(-3);
Expand All @@ -162,4 +161,4 @@ void Fwens::Steam_HandleGroupRequest(GSClientGroupStatus_t* pCallback)
}

LUA->Pop(2);
}
}
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ GMOD_MODULE_OPEN()

GMOD_MODULE_CLOSE()
{
#ifdef _WIN32
Fwens* fwenVar = Fwens::GetInstance();
delete fwenVar;

#endif
return 0;
}

0 comments on commit 82e363f

Please sign in to comment.