Skip to content

SourceSDK bindings #1

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

Draft
wants to merge 238 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
Show all changes
238 commits
Select commit Hold shift + click to select a range
7e34556
Color.h
SupinePandora43 Feb 4, 2021
ec0dcfe
remove x86, x64 target platforms (use Any CPU)
SupinePandora43 Feb 4, 2021
503cf7c
add COM_TimestampedLog
SupinePandora43 Feb 4, 2021
8ce7a2f
ci
SupinePandora43 Feb 4, 2021
6746f8f
fix linux Build Module step
SupinePandora43 Feb 4, 2021
42994ce
platform based entry points
SupinePandora43 Feb 4, 2021
4c1a4b9
update entry point for linux
SupinePandora43 Feb 4, 2021
b07dc7c
test ConColorMsg(int, in Color, string)
SupinePandora43 Feb 4, 2021
eca89c5
osx ci change
SupinePandora43 Feb 4, 2021
9d1d552
many changes
SupinePandora43 Feb 4, 2021
d9fb932
failed
SupinePandora43 Feb 4, 2021
2d12f4c
remove DMsg, DWarning
SupinePandora43 Feb 4, 2021
84e06f0
add timeout minutes
SupinePandora43 Feb 4, 2021
a4bf2a5
disable Dev* tests
SupinePandora43 Feb 4, 2021
ed77a1a
disable everything except ConColorMsg
SupinePandora43 Feb 4, 2021
205fa96
enable first 3
SupinePandora43 Feb 4, 2021
2213de7
disable Error
SupinePandora43 Feb 4, 2021
1a7ae12
enable everything else
SupinePandora43 Feb 4, 2021
ffbc316
update "EntryPoint"s for DevLog, ConMsg
SupinePandora43 Feb 4, 2021
d93af40
remove not existing methods
SupinePandora43 Feb 4, 2021
c10e55d
fix test
SupinePandora43 Feb 4, 2021
acf1241
add OSX
SupinePandora43 Feb 4, 2021
2015c21
OSX
SupinePandora43 Feb 4, 2021
714186e
add Warning_SpewCallStack
SupinePandora43 Feb 4, 2021
d0a3418
rename src to public
SupinePandora43 Feb 5, 2021
e37f960
add Sys_GetFactory(string module)
SupinePandora43 Feb 5, 2021
79b6ec8
tier1 -> Tier1
SupinePandora43 Feb 5, 2021
6b32758
windows: fix filesystem dll name
SupinePandora43 Feb 6, 2021
a7679ee
fix dll path
SupinePandora43 Feb 6, 2021
75b66d4
add UnmanagedFunctionPointer
SupinePandora43 Feb 6, 2021
4f70a12
add debug stuff
SupinePandora43 Feb 6, 2021
ea60518
fix using int instead of IntPtr
SupinePandora43 Feb 6, 2021
3ca74de
use path
SupinePandora43 Feb 6, 2021
903df3d
add throw if createInterfaceFnPtr==0
SupinePandora43 Feb 6, 2021
9efb093
use IntPtr for CreateInterfaceFn(name)
SupinePandora43 Feb 6, 2021
c51d3de
add result check
SupinePandora43 Feb 6, 2021
a305315
two timeout minutes
SupinePandora43 Feb 6, 2021
8fc21c9
pls work
SupinePandora43 Feb 6, 2021
f1d99b9
use GCHandle
SupinePandora43 Feb 6, 2021
b712a1c
something
SupinePandora43 Feb 7, 2021
301d443
free allocated string
SupinePandora43 Feb 7, 2021
b7c3294
add \n to Warning_SpewCallStack test
SupinePandora43 Feb 7, 2021
71bf125
absolute linux path
SupinePandora43 Feb 7, 2021
4f2fc13
use enums
SupinePandora43 Feb 7, 2021
3c6146a
ClangSharp test
SupinePandora43 Feb 7, 2021
6d6d25e
more
SupinePandora43 Feb 7, 2021
bbee39f
swap
SupinePandora43 Feb 7, 2021
bb56082
debug stuff
SupinePandora43 Feb 7, 2021
facacde
use bool
SupinePandora43 Feb 7, 2021
aba6646
do not pass this
SupinePandora43 Feb 7, 2021
8539968
use filesystem_stdio instead of path
SupinePandora43 Feb 7, 2021
550490c
swap
SupinePandora43 Feb 7, 2021
b13007e
again use void**
SupinePandora43 Feb 7, 2021
452cc02
SourceSDK.CAPI
SupinePandora43 Feb 7, 2021
2652def
formatting
SupinePandora43 Feb 7, 2021
d93cf26
add cmake ci
SupinePandora43 Feb 7, 2021
c5e9854
hmm
SupinePandora43 Feb 7, 2021
5a96e5b
fix windows ci?
SupinePandora43 Feb 7, 2021
b06e26a
improve cmake
SupinePandora43 Feb 7, 2021
4a7395f
use defines
SupinePandora43 Feb 7, 2021
1dd044a
use ubuntu-latest in linux-cmake-build
SupinePandora43 Feb 7, 2021
f9b7c7b
upload artifacts
SupinePandora43 Feb 7, 2021
19121df
tree /f
SupinePandora43 Feb 7, 2021
4e12d27
some changes
SupinePandora43 Feb 7, 2021
e871780
if-no-files-found: error
SupinePandora43 Feb 7, 2021
f23a21d
useVcpkgToolchainFile
SupinePandora43 Feb 7, 2021
46d436a
ugh, fine
SupinePandora43 Feb 7, 2021
b2c9b61
osx
SupinePandora43 Feb 7, 2021
c291d0f
check for APPLE first
SupinePandora43 Feb 7, 2021
e3b21a5
CMAKE_CXX_STANDARD 11
SupinePandora43 Feb 7, 2021
6cb02ef
use gcc
SupinePandora43 Feb 7, 2021
b27e33b
exports
SupinePandora43 Feb 7, 2021
03dd360
disable osx
SupinePandora43 Feb 7, 2021
b01a1ef
remove tree commands
SupinePandora43 Feb 7, 2021
1ed6f20
artifacts whoa!
SupinePandora43 Feb 7, 2021
e7f612c
remove --restore
SupinePandora43 Feb 7, 2021
3fb0f02
use publish folder
SupinePandora43 Feb 7, 2021
df14233
SourceSDK -> GmodNET.SourceSDK
SupinePandora43 Feb 7, 2021
a05403f
update GmodDotNet
SupinePandora43 Feb 7, 2021
3607768
tree
SupinePandora43 Feb 7, 2021
89d6efc
copy to output
SupinePandora43 Feb 7, 2021
17a06be
fix download path
SupinePandora43 Feb 7, 2021
851df19
use GmodNET.SourceSDK namespace
SupinePandora43 Feb 7, 2021
89100f1
add .so extension
SupinePandora43 Feb 7, 2021
9faecac
don't check
SupinePandora43 Feb 7, 2021
bfb6393
throw exception on IntPtr.Zero
SupinePandora43 Feb 7, 2021
e214929
use string as argument to CreateInterfaceFn
SupinePandora43 Feb 7, 2021
192980b
IAppSystem c
SupinePandora43 Feb 8, 2021
ef6d58f
fix NativeLibraryResolver
SupinePandora43 Feb 8, 2021
2bdb25f
add const FILESYSTEM_INTERFACE_VERSION
SupinePandora43 Feb 8, 2021
40444c3
IBaseFileSystem c api
SupinePandora43 Feb 8, 2021
d879f79
implement some of IBaseFileSystem
SupinePandora43 Feb 8, 2021
1bba934
try
SupinePandora43 Feb 8, 2021
f675b55
use gmod wiki example
SupinePandora43 Feb 8, 2021
6549fc8
use BaseFileSystem
SupinePandora43 Feb 8, 2021
0dac4f0
run test in OnTick
SupinePandora43 Feb 8, 2021
ba18a98
BaseFileSystem 14/17 implemented
SupinePandora43 Feb 8, 2021
972e793
spam engine.CloseServer
SupinePandora43 Feb 8, 2021
e4a6162
read map
SupinePandora43 Feb 8, 2021
b47a9a9
don't throw
SupinePandora43 Feb 8, 2021
0c0d6ba
test without loading module
SupinePandora43 Feb 8, 2021
87c649c
return test
SupinePandora43 Feb 8, 2021
a8ac070
remove binaries from git
SupinePandora43 Feb 9, 2021
1a609ab
fix git ignore
SupinePandora43 Feb 9, 2021
da3dcc2
GetSystem
SupinePandora43 Feb 9, 2021
0c7e887
VBaseFileSystem test
SupinePandora43 Feb 9, 2021
f308ee5
allocate manually
SupinePandora43 Feb 9, 2021
f62ca56
add filesystem.h enums
SupinePandora43 Feb 10, 2021
b720c53
implement FileSystem.AddSearchPath
SupinePandora43 Feb 10, 2021
e347fba
move imports to internal class
SupinePandora43 Feb 11, 2021
65e9090
disable isurface_c.cpp
SupinePandora43 Feb 11, 2021
496a5f6
PrintSearchPaths
SupinePandora43 Feb 11, 2021
37132a7
remove useless 2 calls
SupinePandora43 Feb 11, 2021
71326d8
disable IFileSystem
SupinePandora43 Feb 12, 2021
9aebff8
COM_TimestampedLog: replace params string[] with string
SupinePandora43 Feb 12, 2021
1d229cf
use static classes
SupinePandora43 Feb 12, 2021
7a5dace
add Version field
SupinePandora43 Feb 12, 2021
b04cfb3
changes to TestModule.cs
SupinePandora43 Feb 12, 2021
19dcc29
full absolute path for linux
SupinePandora43 Feb 12, 2021
d388372
disable COM_TimestampedLog
SupinePandora43 Feb 12, 2021
f57d704
edit build.yml
SupinePandora43 Feb 12, 2021
7c1ad8b
do not unload library
SupinePandora43 Feb 12, 2021
f823940
revert absolute full path
SupinePandora43 Feb 12, 2021
e70e77a
add debug
SupinePandora43 Feb 12, 2021
fe9594d
oof
SupinePandora43 Feb 12, 2021
d88df9c
upload .nupkg
SupinePandora43 Feb 12, 2021
4550794
do not unload module
SupinePandora43 Feb 12, 2021
364782b
add prints xD
SupinePandora43 Feb 12, 2021
463efa5
add pack script
SupinePandora43 Feb 12, 2021
14818aa
message
SupinePandora43 Feb 12, 2021
da70c62
AddSearchPath
SupinePandora43 Feb 12, 2021
3f34378
change things
SupinePandora43 Feb 12, 2021
1c81024
fix file reading
SupinePandora43 Feb 13, 2021
06f2042
fix file reading
SupinePandora43 Feb 13, 2021
63cc573
rewrite code
SupinePandora43 Feb 13, 2021
59fa136
steam and gmod caching
SupinePandora43 Feb 13, 2021
c0fa40f
increase timeout to 3
SupinePandora43 Feb 13, 2021
9de14db
cleanup step and _new
SupinePandora43 Feb 13, 2021
b421cf9
/S
SupinePandora43 Feb 13, 2021
62cb18a
fix delete
SupinePandora43 Feb 13, 2021
4386f75
fix IntPtr.Zero
SupinePandora43 Feb 13, 2021
5392ecb
use SetCustomNativeLibraryResolver
SupinePandora43 Feb 13, 2021
1166f32
fix
SupinePandora43 Feb 13, 2021
b28f200
delete stuff
SupinePandora43 Feb 13, 2021
44d9355
NativeLibrary.Free(sourcesdkc)
SupinePandora43 Feb 13, 2021
4a3dd7c
skip linux
SupinePandora43 Feb 14, 2021
193b1a3
disable IFileSystem test
SupinePandora43 Feb 14, 2021
447c371
remove caching
SupinePandora43 Feb 14, 2021
3bb3ec9
disable NativeLibraryResolver
SupinePandora43 Feb 14, 2021
9c1b816
IFileSystem:
SupinePandora43 Feb 15, 2021
a7b2adb
let me guess, it will not work
SupinePandora43 Feb 15, 2021
9267840
return default IntPtr
SupinePandora43 Feb 15, 2021
a9e5b78
try something else
SupinePandora43 Feb 16, 2021
420f247
reduce retention-days to 90
SupinePandora43 Feb 16, 2021
eb0c702
enable test
SupinePandora43 Feb 16, 2021
a72de6a
enable linux test
SupinePandora43 Feb 16, 2021
65815a3
some documentation
SupinePandora43 Feb 16, 2021
ca8323c
fix debug message
SupinePandora43 Feb 16, 2021
e44f2de
Free twice
SupinePandora43 Feb 16, 2021
ec9b83e
do not unload twice
SupinePandora43 Feb 16, 2021
c2ca3c9
IFileSystem
SupinePandora43 Feb 16, 2021
cacceb1
IFileSystem + Open file operations:
SupinePandora43 Feb 17, 2021
bb60cac
run ci on all branches
SupinePandora43 Feb 19, 2021
908e1ee
add DX_TO_GL_ABSTRACTION define
SupinePandora43 Feb 19, 2021
3592236
Merge branch 'main' of https://github.com/SupinePandora43/GmodDotNet.…
SupinePandora43 Feb 19, 2021
0e5c6b2
add NormalDecodeMode_t
SupinePandora43 Feb 20, 2021
7728a29
sort usings
SupinePandora43 Feb 20, 2021
49cfe99
GetDependencies test
SupinePandora43 Feb 20, 2021
472eded
use ref type
SupinePandora43 Feb 20, 2021
8a92a65
StructLayout(LayoutKind.Sequential)
SupinePandora43 Feb 20, 2021
56435f6
match field names
SupinePandora43 Feb 20, 2021
8c51829
add more attributes to DllImport
SupinePandora43 Feb 20, 2021
491098d
try using single struct
SupinePandora43 Feb 20, 2021
6ff5900
revert the last commit
SupinePandora43 Feb 20, 2021
cd2f7ba
i said revert
SupinePandora43 Feb 20, 2021
593b707
try using IntPtr
SupinePandora43 Feb 20, 2021
961bb38
use IntPtr
SupinePandora43 Feb 20, 2021
44e5f05
vguimatsurface test
SupinePandora43 Feb 20, 2021
bc3cde5
get tier testing
SupinePandora43 Feb 21, 2021
6aeced1
remove unused using
SupinePandora43 Feb 21, 2021
3c77dff
add new path test
SupinePandora43 Feb 21, 2021
591540e
FileSystem: implement Dynamic library operations, File searching oper…
SupinePandora43 Feb 21, 2021
b5461d2
add Obsolete
SupinePandora43 Feb 21, 2021
66265fb
CDbgFmtMsg
SupinePandora43 Feb 21, 2021
7b90676
use different naming
SupinePandora43 Feb 21, 2021
993f122
inline DBG_CDbgFmtMsg implementation
SupinePandora43 Feb 21, 2021
be5259a
scrap CDbgFmtMsg
SupinePandora43 Feb 21, 2021
82c1fe9
add readonly to delegates
SupinePandora43 Feb 21, 2021
53e007f
Update filesystem_c.cpp
SupinePandora43 Feb 21, 2021
83c9933
remove cast
SupinePandora43 Feb 22, 2021
1f68205
Merge pull request #1 from SupinePandora43/IFileSystem-no-cast
SupinePandora43 Feb 22, 2021
fe9932d
add length check to CDbgFmtMsg
SupinePandora43 Feb 22, 2021
2e499dd
add hint file
SupinePandora43 Feb 22, 2021
b1d8d84
delegates
SupinePandora43 Feb 22, 2021
5972d11
omit entry points
SupinePandora43 Feb 23, 2021
795d1ab
SymbolResolver.cs
SupinePandora43 Feb 23, 2021
241b7cc
single line entry points
SupinePandora43 Feb 23, 2021
63ccfcb
fix name violation
SupinePandora43 Feb 23, 2021
b3a18d2
Merge pull request #2 from SupinePandora43/new-entrypoint-loading
SupinePandora43 Feb 23, 2021
e8e0ecd
client side linux/osx library support
SupinePandora43 Feb 26, 2021
c2eb2a5
working ISurface
SupinePandora43 May 5, 2021
b67474e
update
SupinePandora43 May 6, 2021
cee7c40
DllImportGenerator thing
SupinePandora43 May 7, 2021
0659da3
update gmod_sdk
SupinePandora43 May 7, 2021
81b6d7f
add DotNet Experimental
SupinePandora43 May 7, 2021
1eedbd3
fix nuget
SupinePandora43 May 7, 2021
3f45641
fix nuget
SupinePandora43 May 7, 2021
80dfeb5
PrivateAssets="All"
SupinePandora43 May 7, 2021
03dc9f7
fix nuget
SupinePandora43 May 7, 2021
6dfb88a
fix nuget
SupinePandora43 May 7, 2021
30ec049
fix
SupinePandora43 May 7, 2021
e18cc87
install net6
SupinePandora43 May 7, 2021
8042e2f
remove unused things
SupinePandora43 May 7, 2021
2092895
higher timeout
SupinePandora43 May 7, 2021
ba04343
stackalloc
SupinePandora43 May 7, 2021
797d1cd
IMatSystemSurface
SupinePandora43 May 7, 2021
236d953
IMatSystemSurface
SupinePandora43 May 7, 2021
77293df
IMaterialSystem
SupinePandora43 May 7, 2021
7d504fe
IMaterialSystem
SupinePandora43 May 8, 2021
8430136
inline
SupinePandora43 May 8, 2021
fba4e22
mark as BlittableType
SupinePandora43 May 8, 2021
2478805
IMaterialSystem
SupinePandora43 May 8, 2021
20a7d41
IMaterialSystem_GetHardwareConfig
SupinePandora43 May 8, 2021
df0fc4b
IMaterialSystemHardwareConfig
SupinePandora43 May 8, 2021
b966106
simplify
SupinePandora43 May 8, 2021
3b8ea76
IMaterialSystemHardwareConfig
SupinePandora43 May 9, 2021
5cbc837
IMaterialSystemHardwareConfig
SupinePandora43 May 9, 2021
3d9d986
IMaterialSystem
SupinePandora43 May 9, 2021
ec8565b
readonly, nullcheck
SupinePandora43 May 9, 2021
03c519d
ITexture & RenderTargets
SupinePandora43 May 9, 2021
3743029
GetRenderTargetExampleModule
SupinePandora43 May 10, 2021
a69ac8b
update
SupinePandora43 May 10, 2021
e610d24
Public Internal pointer
SupinePandora43 May 10, 2021
2d13c1e
ISurface.DrawTexturedRect
SupinePandora43 May 10, 2021
79e2cee
use sourcesdk's DrawTexturedRect
SupinePandora43 May 10, 2021
945d7d6
fix table
SupinePandora43 May 10, 2021
55ea4c5
fix sourcesdkc resolver
SupinePandora43 May 10, 2021
497408a
fix CurTime
SupinePandora43 May 10, 2021
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
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[*]
end_of_line = crlf
charset = utf-8
indent_style = tab
indent_size = tab
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
indent_size = 2
196 changes: 196 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
name: Build & Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ main ]
jobs:
linux-cmake-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: 'CMake'
uses: lukka/run-cmake@v2
with:
cmakeListsOrSettingsJson: CMakeListsTxtBasic
cmakeBuildType: Release
buildDirectory: '${{ github.workspace }}/out'
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: linux-x64
path: "out/SourceSDK.CAPI/libsourcesdkc.so"
retention-days: 1
if-no-files-found: error
windows-cmake-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
- name: 'CMake'
uses: lukka/run-cmake@v2
with:
cmakeListsOrSettingsJson: CMakeSettingsJson
cmakeBuildType: Release
buildDirectory: '${{ github.workspace }}/out'
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: win-x64
path: "out/x64-Release/SourceSDK.CAPI/sourcesdkc.dll"
retention-days: 1
if-no-files-found: error
#osx-cmake-build:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: recursive
# - uses: ilammy/msvc-dev-cmd@v1
# - name: 'CMake'
# uses: lukka/run-cmake@v2
# with:
# cmakeListsOrSettingsJson: CMakeListsTxtBasic
# cmakeBuildType: Release
# buildDirectory: '${{ github.workspace }}/out'
# - name: Upload Artifact
# uses: actions/upload-artifact@v2
# with:
# name: osx-x64
# path: "out/SourceSDK.CAPI/libsourcesdkc.dylib"
# retention-days: 10
# if-no-files-found: error
Build:
needs: [ linux-cmake-build, windows-cmake-build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core SDK
uses: actions/[email protected]
with:
dotnet-version: 5.0.100
- name: Setup .NET Core SDK
uses: actions/[email protected]
with:
dotnet-version: 6.0.100-preview.3.21202.5
- name: Download linux-x64
uses: actions/download-artifact@v2
with:
name: linux-x64
path: SourceSDK/runtimes/linux-x64/native
- name: Download win-x64
uses: actions/download-artifact@v2
with:
name: win-x64
path: SourceSDK/runtimes/win-x64/native
- name: Build Solution
run: dotnet publish SourceSDK.sln --configuration Release
- name: Pack
run: dotnet pack SourceSDK.sln --configuration Release
- name: Upload nuget package
uses: actions/upload-artifact@v2
with:
name: sourcesdk
path: SourceSDK/bin/Release/*.nupkg
retention-days: 90
if-no-files-found: error
- name: Upload SourceSDK.dll
uses: actions/upload-artifact@v2
with:
name: sourcesdk
path: SourceSDK/bin/Release/net5/publish/*
retention-days: 1
if-no-files-found: error
- name: Upload SourceSDKTest.dll
uses: actions/upload-artifact@v2
with:
name: sourcesdktest
path: SourceSDK.Test/bin/Release/net5/publish/*
retention-days: 1
if-no-files-found: error
Test-linux:
needs: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download SteamCMD
run: |
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz
rm -rfv steamcmd_linux.tar.gz
- name: Install Garry's Mod Dedicated Server
run: |
./steamcmd.sh +login anonymous +force_install_dir gmod "+app_update 4020 -beta x86-64 validate" +quit
- name: Install GmodDotNet
run: |
wget https://gleb-krasilich.fra1.digitaloceanspaces.com/GmodNETStorage/storage/gmod-dot-net-linux.0.7.0-beta.2.32934270.master.tar.gz -O gmoddotnet.tar.gz
mkdir ./gmod/garrysmod/lua/bin
tar -xvzf gmoddotnet.tar.gz -C ./gmod/garrysmod/lua/bin
rm -rfv gmoddotnet.tar.gz
- name: Download SourceSDKTest
uses: actions/download-artifact@v2
with:
name: sourcesdktest
path: ./gmod/garrysmod/lua/bin/Modules/SourceSDKTest/
- run: tree
- name: Copy test.lua
run: cp .github/workflows/test.lua ./gmod/garrysmod/lua/autorun
- name: Run Garry's Mod
run: ./srcds_run_x64 -game garrysmod -systemtest -condebug +developer 1 +exec "server.cfg" +gamemode sandbox +map gm_construct +maxplayers 2 +sv_hibernate_think 1 || true
working-directory: ./gmod/
timeout-minutes: 5
continue-on-error: true
- name: Print log
run: cat gmod/garrysmod/console.log
- name: Tests successfull?
uses: andstor/file-existence-action@v1
with:
files: "gmod/garrysmod/data/success.txt"
allow_failure: true
Test-windows:
needs: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Download SteamCMD
run: |
curl https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip -O -L
powershell -Command 'Expand-Archive -LiteralPath ./steamcmd.zip -DestinationPath ./'
del steamcmd.zip
- name: Install Garry's Mod Dedicated Server
shell: bash
run: |
./steamcmd.exe +login anonymous +force_install_dir gmod "+app_update 4020 -beta x86-64 validate" +quit || true
- name: Install GmodDotNet
shell: bash
run: |
curl -o gmoddotnet.zip https://gleb-krasilich.fra1.digitaloceanspaces.com/GmodNETStorage/storage/gmod-dot-net-windows.0.7.0-beta.2.32934270.master.zip -O -L
mkdir ./gmod/garrysmod/lua/bin
powershell -Command 'Expand-Archive -LiteralPath ./gmoddotnet.zip -DestinationPath ./gmod/garrysmod/lua/bin'
- name: Download SourceSDKTest
uses: actions/download-artifact@v2
with:
name: sourcesdktest
path: ./gmod/garrysmod/lua/bin/Modules/SourceSDKTest/
- name: Copy test.lua
run: cp .github/workflows/test.lua ./gmod/garrysmod/lua/autorun
- name: Run Garry's Mod
shell: bash
run: |
powershell -Command './gmod/srcds_win64.exe -console -systemtest -condebug -game "garrysmod" +developer 1 +exec "server.cfg" +gamemode sandbox +map gm_construct +maxplayers 2 +sv_hibernate_think 1'
powershell -Command 'Wait-Process -Name srcds_win64'
continue-on-error: true
timeout-minutes: 3
- name: Print log
shell: bash
run: cat gmod/garrysmod/console.log
- name: Tests successfull?
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "gmod/garrysmod/data/success.txt"
allow_failure: true
18 changes: 18 additions & 0 deletions .github/workflows/test.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
hook.Add("Tick", "CloseServer", engine.CloseServer)
require("dotnet")

local function run_test()
print("loading")
local module_loaded = dotnet.load("SourceSDKTest")
assert(module_loaded)

-- uhm

print("unloading")
local module_unloaded = dotnet.unload("SourceSDKTest")
assert(module_unloaded)
end

run_test()
print("tests are successful!")
file.Write("success.txt", "done")
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vs
bin
obj
out
*.dll
*.so
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "SourceSDK.CAPI/gmod_sdk"]
path = SourceSDK.CAPI/gmod_sdk
url = https://github.com/danielga/garrysmod_common.git
branch = x86-64-support-sourcesdk
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# CMakeList.txt : Top-level CMake project file, do global configuration
# and include sub-projects here.
#
cmake_minimum_required (VERSION 3.8)

project ("SourceSDK")

# Include sub-projects.
add_subdirectory ("SourceSDK.CAPI")
14 changes: 14 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"configurations": [
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
}
]
}
12 changes: 12 additions & 0 deletions GetRenderTargetExample/GetRenderTargetExample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="GmodNET.API" Version="0.7.0-beta.2.32934270.master" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SourceSDK\GmodNET.SourceSDK.csproj" />
</ItemGroup>
</Project>
Loading