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

#38 Add synchronisation for client and server mods #84

Closed
wants to merge 82 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
374fc1c
Quick and dirty rework of Client and Server Developer want to rework …
Ismoh May 11, 2022
13a973b
A lot Client and Server rework. Tried EZGUI. #48
Ismoh May 13, 2022
c9fd6c2
Dependabot?!
Ismoh May 16, 2022
dbe343b
Renamed username to name. Extended logger with log channel. #48
Ismoh May 19, 2022
158cad1
Reworked sock.lua and updated EZGUI to 0.1.2
Ismoh May 19, 2022
cac234e
Trying to add lfs
Ismoh May 20, 2022
85908d9
Little bit UI. SaveSlot. Logger. #48
Ismoh May 20, 2022
4a3947f
Clean up #48
Ismoh May 22, 2022
b0968bb
world seed does not load #48
Ismoh May 22, 2022
d675a1f
Seed synced
Ismoh May 23, 2022
abd90df
Reworking client/server. #48
Ismoh May 26, 2022
932c976
Reworking client/server. 2 #48
Ismoh May 26, 2022
2b554b4
Updated EZGUI to v0.2.0
Ismoh May 26, 2022
64f8c36
ui changes #48
Ismoh May 26, 2022
2ba94ad
new ui class added #48
Ismoh May 26, 2022
b369ee8
ui changes #48
Ismoh May 27, 2022
fd7fea5
Fixing unit tests #48
Ismoh May 27, 2022
0da5e49
Fixing and extending unit tests #48
Ismoh May 27, 2022
f10daa6
Fixing unit tests #48
Ismoh May 27, 2022
3a042c3
Fixing unit tests #48
Ismoh May 27, 2022
cb5ea15
Fixing unit tests #48
Ismoh May 27, 2022
ad9d2b2
Fixing unit tests #48
Ismoh May 27, 2022
d785a20
Ui changes #48
Ismoh May 29, 2022
ac59e6d
Ui changes #48
Ismoh May 29, 2022
5bdbf1d
Ui changes #48
Ismoh May 30, 2022
b6eddf7
Ui changes #48
Ismoh May 30, 2022
cb02e7e
RTT halved and UI update #48
Ismoh Jun 2, 2022
2e04adf
Commit before updating EZGUI
Ismoh Jun 5, 2022
b85aea8
Trying to fix Ezgui #48
Ismoh Jun 5, 2022
768f334
ezgui fixed #48
Ismoh Jun 5, 2022
3116e84
newNuid #48
Ismoh Jun 5, 2022
a0d0e95
need nuid #48
Ismoh Jun 6, 2022
7cfcd52
need nuid 2 #48
Ismoh Jun 6, 2022
de38b81
need nuid 3 #48
Ismoh Jun 6, 2022
138b327
need nuid 4 #48
Ismoh Jun 6, 2022
db1567c
need nuid 5 #48
Ismoh Jun 6, 2022
ba17702
Adding luacheck
Ismoh Jun 8, 2022
b7ceb58
Fix missing owner
BlueAmulet Jun 8, 2022
236bb18
Only consider root entities for syncing
BlueAmulet Jun 8, 2022
f96b29f
Better velocity handling
BlueAmulet Jun 9, 2022
907cedf
#48 Small guid changes.
Ismoh Jun 9, 2022
6943c46
Merge branch '48-developer-want-to-rework-client-and-server-modulescl…
Ismoh Jun 9, 2022
d9c1280
#48 Let me do my own acknowledgement!
Ismoh Jun 9, 2022
b47d5b4
#48 Let me do my own acknowledgement! 2
Ismoh Jun 9, 2022
1bc062e
#48 Added a lot of checks.
Ismoh Jun 12, 2022
9d5ee04
#48 Still duplicated entities.
Ismoh Jun 12, 2022
59cb7ca
#48 Guid and entityData
Ismoh Jun 20, 2022
db7cdeb
#48 entityData
Ismoh Jun 21, 2022
154f4c9
#48 Trying to fix 'alreadySent'
Ismoh Jun 22, 2022
19ca2ee
#48 New teaser gif added.
Ismoh Jun 22, 2022
77894c8
#48 Added polymorphism and version.
Ismoh Jun 26, 2022
c9ea4d1
#48 Hopefully fixed public ip issue.
Ismoh Jun 30, 2022
eeb7933
Add silent os.execute and io.popen
BlueAmulet Jul 14, 2022
fee9992
Block FFI extension on Linux
BlueAmulet Jul 14, 2022
4ba12ec
Merge branch 'develop' of https://github.com/Ismoh/NoitaMP into 48-de…
Ismoh Jul 15, 2022
ac22b0f
Merge pull request #68 from BlueAmulet/ffi-ext
Ismoh Jul 15, 2022
9fbff84
#48 Added profiler.lua for being able to find bottlenecks!
Ismoh Jul 21, 2022
3fc1819
#48 Added new de-/serializer (MessagePack) and de-/compressor (ZStand…
Ismoh Aug 3, 2022
46ff02a
#48 Fixed removing AiComponents. Removed some profiler hacks. Added t…
Ismoh Aug 26, 2022
9e939b1
#48 Adding custom testing map.
Ismoh Aug 27, 2022
923b3a3
#48 Fixed non-working custom map/biome.
Ismoh Aug 27, 2022
7262b09
#48 Changed custom map. Reworking GUID, because locally same GUID can…
Ismoh Aug 31, 2022
c751a19
#69 Added CustomProfiler.lua to profile NoitaMP scripts only! Changed…
Ismoh Sep 5, 2022
e57f7e0
#69 Added profiling of Noita API ModSetting* functions. Changed Custo…
Ismoh Sep 24, 2022
13e38fb
Merge branch 'develop' of https://github.com/Ismoh/NoitaMP into 48-de…
Ismoh Oct 8, 2022
38d5d52
#48 Fixed bug where zstd wasn't able to be loaded.
Ismoh Oct 8, 2022
82b19ff
#48 Fixed libraries issue. Added ModSetting for dis-/enable logger at…
Ismoh Oct 9, 2022
2c6c0e7
#48 Fixed 'not enough memory'. Refactored profiler and plotly.lua to …
Ismoh Oct 14, 2022
aaf62b4
Updated plotly.js version from 2.9.0 to 2.16.0
Ismoh Oct 16, 2022
8063381
Added bar chart settings
Ismoh Oct 16, 2022
04169f9
Added bar chart entry text
Ismoh Oct 16, 2022
261c01f
#48 Extended profiling to find the FPS drop issue.
Ismoh Oct 16, 2022
ee50efb
Merge branch '48-developer-want-to-rework-client-and-server-modulescl…
Ismoh Oct 16, 2022
e3fc71b
Merge branch 'develop' of https://github.com/Ismoh/NoitaMP into 48-de…
Ismoh Oct 16, 2022
be99da6
#48 Added garbage collector functions. Added git submodules updater. …
Ismoh Oct 17, 2022
66869a2
#48 Updated git submodules updater.
Ismoh Oct 17, 2022
69c5a35
implement server onNeedModList function and add needModList/Content e…
ofoxsmith Oct 25, 2022
e054131
Finish implementing server side mod sync functions and add onNeedModC…
ofoxsmith Oct 26, 2022
aa823b0
make modListCached a prop on Server class
ofoxsmith Oct 26, 2022
5f212a5
make onNeedModContent also return workshop id to avoid overwriting wo…
ofoxsmith Oct 27, 2022
4a46909
Finish implementing mod synchronisation
ofoxsmith Oct 27, 2022
e91bdfe
make onNeedModList run on connection to server
ofoxsmith Oct 27, 2022
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
Binary file added .debug/custom-mp-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .debug/luacheck-v-0-23-0.exe
Binary file not shown.
Binary file added .debug/sh.exe.lnk
Binary file not shown.
Binary file added .debug/where-is-the-lag-comming-from.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ updates:
day: "thursday"
time: "18:00"
timezone: "Europe/Berlin"
target-branch: "develop"
target-branch: "dependencies"

- package-ecosystem: "gitsubmodule"
directory: "."
Expand All @@ -24,4 +24,4 @@ updates:
day: "thursday"
time: "18:00"
timezone: "Europe/Berlin"
target-branch: "develop"
target-branch: "dependencies"
90 changes: 0 additions & 90 deletions .github/workflows/ubuntu-latest-lua-unit-testing.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/update-git-submodules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Git submodule updater

on:
push:

schedule:
- cron: '0 6 * * 0'
workflow_dispatch:

jobs:
update-submodules:
name: Update submodules
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
persist-credentials: false

# - name: Import GPG key
# id: import-gpg
# uses: crazy-max/[email protected]
# with:
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
# passphrase: ${{ secrets.GPG_PASS }}
# git_config_global: true
# git_user_signingkey: true
# git_commit_gpgsign: true

- name: Update submodules
run: |
git submodule foreach 'git fetch -t --unshallow
git checkout "$(git describe --tags --abbrev=0 origin/HEAD)"'

- name: Try to commit
run: |
if git commit -am"$(
echo 'Update submodules (automated)'
echo
git submodule status | grep '^+' | cut '-d ' -f2-
)"; then
./configure
make
git push
fi
# env:
# GITHUB_TOKEN: ${{ secrets.GH_PASS }}
# GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }}
# GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }}
# GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }}
# GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }}
1 change: 0 additions & 1 deletion .github/workflows/version-and-changelog-update.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Version and changelog update
on:

pull_request_target:
types: [ opened, edited, synchronize, closed ]
jobs:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/windows-latest-lua-unit-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
run: |
#echo "C:\msys64\mingw32\bin" >> $GITHUB_PATH
#cp C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\x86_64-w64-mingw32-gcc.exe C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\mingw32-gcc.exe

Start-Process -FilePath "${{ env.temp_dir }}\luarocks-3.8.0-windows-32\luarocks.exe" -ArgumentList "--lua-dir=${{ env.lua_install_dir }} --lua-version=5.1 --tree=${{ env.lua_install_dir }} install luacov" -Wait -NoNewWindow
Start-Process -FilePath "${{ env.temp_dir }}\luarocks-3.8.0-windows-32\luarocks.exe" -ArgumentList "--lua-dir=${{ env.lua_install_dir }} --lua-version=5.1 --tree=${{ env.lua_install_dir }} install lua-path" -Wait -NoNewWindow
Start-Process -FilePath "${{ env.temp_dir }}\luarocks-3.8.0-windows-32\luarocks.exe" -ArgumentList "--lua-dir=${{ env.lua_install_dir }} --lua-version=5.1 --tree=${{ env.lua_install_dir }} install dkjson" -Wait -NoNewWindow
Expand All @@ -134,13 +134,13 @@ jobs:

Start-Process -FilePath "${{ env.lua_install_bin_dir }}\luacov.bat" -Wait -NoNewWindow

- name: Generate coverage report with luacov-coveralls
shell: cmd
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_DEBUG: true
run: |
#${{ env.lua_install_bin_dir }}\luacov-coveralls.bat -v
# - name: Generate coverage report with luacov-coveralls
# shell: cmd
# env:
# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_DEBUG: true
# run: |
# ${{ env.lua_install_bin_dir }}\luacov-coveralls.bat -v

- name: Fix codecov path issue
shell: pwsh
Expand Down
6 changes: 4 additions & 2 deletions .testing/tests/mods/noita-mp/config_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ local lu = require("luaunit")
TestConfig = {}

function TestConfig:setUp()
print("\nsetUp")
print("\n setUp")
end

function TestConfig:tearDown()
print("tearDown\n")
end
end

os.exit(lu.LuaUnit.run())
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,26 @@ end

function TestStringExtensions:tearDown()
print("tearDown\n")
end
end

function TestStringExtensions:testExtendAndCutStringToLength()
lu.assertErrorMsgEquals("var is not a string.", string.ExtendOrCutStringToLength, 1)
lu.assertErrorMsgEquals("length is not a number.", string.ExtendOrCutStringToLength, "var", "length")
lu.assertErrorMsgContains(
"char is not a character. string.len(char) > 1 = ",
string.ExtendOrCutStringToLength,
"var",
1,
"character"
)

local expected = "12345"
local actual = string.ExtendOrCutStringToLength("12345678910", 5, " ")
lu.assertEquals(actual, expected)

local expected2 = "1234 "
local actual2 = string.ExtendOrCutStringToLength("1234", 10, " ")
lu.assertEquals(actual2, expected2)
end

os.exit(lu.LuaUnit.run())
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ end

function TestInit_:tearDown()
print("tearDown\n")
end
end

os.exit(lu.LuaUnit.run())
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ end

function TestInitLogger:tearDown()
print("tearDown\n")
end
end

os.exit(lu.LuaUnit.run())
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ end

function TestInitPackageLoading:tearDown()
print("tearDown\n")
end
end

os.exit(lu.LuaUnit.run())
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ end

function TestEntityUtils:tearDown()
print("tearDown\n")
end
end

os.exit(lu.LuaUnit.run())
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ end

function TestGlobalsUtils:tearDown()
print("tearDown\n")
end
end

os.exit(lu.LuaUnit.run())
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ end

function TestNetworkVscUtils:tearDown()
print("tearDown\n")
end
end

os.exit(lu.LuaUnit.run())
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ end

function TestNuidUtils:tearDown()
print("tearDown\n")
end
end

os.exit(lu.LuaUnit.run())
11 changes: 11 additions & 0 deletions .testing/tests/mods/noita-mp/files/scripts/util/guid_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ TestGuid = {}

function TestGuid:setUp()
print("\nsetUp")
-- Mock Noita Api global functions
_G.DebugGetIsDevBuild = function()
return false
end

--- Mocked in guid_test.lua
--- @param id string
--- @return nil nil Returns nil in this case.
_G.ModSettingGet = function(id)
return nil
end
end

function TestGuid:tearDown()
Expand Down
27 changes: 7 additions & 20 deletions .testing/tests/mods/noita-mp/files/scripts/util/util_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ TestUtil = {}

function TestUtil:setUp()
print("\nsetUp")

--- Mocked in guid_test.lua
--- @param id string
--- @return nil nil Returns nil in this case.
_G.ModSettingGet = function(id)
return nil
end
end

function TestUtil:tearDown()
Expand Down Expand Up @@ -36,24 +43,4 @@ function TestUtil:testIsEmpty()
lu.assertIsTrue(util.IsEmpty({}))
end

function TestUtil:testExtendAndCutStringToLength()
lu.assertErrorMsgEquals("var is not a string.", util.ExtendAndCutStringToLength, 1)
lu.assertErrorMsgEquals("length is not a number.", util.ExtendAndCutStringToLength, "var", "length")
lu.assertErrorMsgContains(
"char is not a character. string.len(char) > 1 = ",
util.ExtendAndCutStringToLength,
"var",
1,
"character"
)

local expected = "12345"
local actual = util.ExtendAndCutStringToLength("12345678910", 5, " ")
lu.assertEquals(actual, expected)

local expected2 = "1234 "
local actual2 = util.ExtendAndCutStringToLength("1234", 10, " ")
lu.assertEquals(actual2, expected2)
end

os.exit(lu.LuaUnit.run())
4 changes: 3 additions & 1 deletion .testing/tests/mods/noita-mp/init_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ end

function TestInit:tearDown()
print("tearDown\n")
end
end

os.exit(lu.LuaUnit.run())
5 changes: 0 additions & 5 deletions .version

This file was deleted.

Loading