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

Development #353

Merged
merged 8 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/deploy-to-smr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ on:
should_upload:
type: boolean
default: true
dev_run:
type: boolean
default: false
workflow_call:
secrets:
SMR_API_KEY:
required: true
SMR_API_KEY_DEV:
required: false
RELEASE_WEBHOOK_URL:
required: true

Expand All @@ -34,11 +39,11 @@ jobs:
per_page: 1,
});
const release = response.data[0];
if (release.draft) {
if (!${{inputs.dev_run == true}} && release.draft) {
core.setFailed('Found Release is a draft!');
return;
}
core.setOutput('body', btoa(release.body.replaceAll("*", "\\*")));
core.setOutput('body', release.body.replaceAll("*", "*"));
core.setOutput('name', release.name);

- name: Download FicsIt-Networks Version
Expand All @@ -58,7 +63,8 @@ jobs:
if: ${{inputs.should_upload}}
env:
BODY: ${{steps.find-release.outputs.body}}
run: ficsit --api-key "${{secrets.SMR_API_KEY}}" smr upload 8d8gk4imvFanRs FicsItNetworks.zip $BODY
run: |
ficsit ${{ inputs.dev_run && '--api-base https://api.ficsit.dev' || '' }} --api-key "${{ inputs.dev_run && secrets.SMR_API_KEY_DEV || secrets.SMR_API_KEY }}" smr upload ${{ inputs.dev_run && '27CoRS8wTsW1wD' || '8d8gk4imvFanRs'}} FicsItNetworks.zip "$BODY"

- name: Wait for Approval
uses: actions/github-script@v7
Expand All @@ -68,7 +74,7 @@ jobs:
await new Promise(resolve => setTimeout(resolve, 5000));
let response = await fetch("https://api.ficsit.app/v2/query", {
method: "POST",
headers: {"Cookies": "token=${{secrets.SMR_API_KEY}}", "Content-Type":"application/json"},
headers: {"Cookies": "token=${{ inputs.dev_run && secrets.SMR_API_KEY_DEV || secrets.SMR_API_KEY }}", "Content-Type":"application/json"},
body: JSON.stringify({
query: '{getModByReference(modReference:"FicsItNetworks"){versions(filter:{order_by:created_at}){version approved virustotal_results{safe}}}}'
})
Expand All @@ -92,6 +98,7 @@ jobs:
}
send-discord-release-message:
needs: deploy-to-smr
if: ${{!inputs.dev_run}}
uses: ./.github/workflows/send-discord-release.yml
secrets:
RELEASE_WEBHOOK_URL: ${{ secrets.RELEASE_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion FicsItNetworks.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"FileVersion": 3,
"Version": 0,
"VersionName": "0.3",
"SemVersion": "0.3.25",
"SemVersion": "0.3.26",
"FriendlyName": "FicsIt-Networks",
"Description": "Adds a computer network and programmable computers to the Game.",
"Category": "Modding",
Expand Down
9 changes: 5 additions & 4 deletions Source/FicsItNetworksLua/Private/FINLua/LuaGlobalLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace FINLua {

int luaYield(lua_State* L) {
const int args = lua_gettop(L);
return luaFIN_yield(L, args+1, NULL, &luaYieldResume);
return luaFIN_yield(L, args, NULL, &luaYieldResume);
}

int luaResume(lua_State* L); // pre-declare
Expand All @@ -57,13 +57,13 @@ namespace FINLua {

int luaResume(lua_State* L) {
const int args = lua_gettop(L);
if (!lua_isthread(L, 1)) return luaL_argerror(L, 1, "is no thread");
luaL_checktype(L, 1, LUA_TTHREAD);
lua_State* thread = lua_tothread(L, 1);

if (!lua_checkstack(thread, args - 1)) {
lua_pushboolean(L, false);
lua_pushliteral(L, "too many arguments to resume");
return 1;
return 2;
}

// attach hook for out-of-time exception if thread got loaded from save and hook is not applied
Expand All @@ -76,12 +76,13 @@ namespace FINLua {
const int status = lua_resume(thread, L, args - 1, &argCount);

if (status == LUA_OK || status == LUA_YIELD) {
luaFINDebug_dumpStack(thread);
if (argCount == 0 && status == LUA_YIELD) {
// A hook yielded the thread
return lua_yieldk(L, 0, NULL, &luaResumeResume);
}

if (status == LUA_YIELD) argCount = argCount-1;
if (status == LUA_YIELD) argCount = argCount-1;

if (!lua_checkstack(L, argCount)) {
lua_pop(thread, argCount);
Expand Down
1 change: 1 addition & 0 deletions Source/FicsItNetworksLua/Private/FINLua/LuaUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ namespace FINLua {
}

void luaFINDebug_dumpStack(lua_State* L) {
UE_LOG(LogFicsItNetworksLua, Warning, TEXT("Dumping stack of thread %p:"), L);
int args = lua_gettop(L);
int negative = 0;
for (; args > 0; --args) {
Expand Down
Loading