Skip to content

Commit e490b0e

Browse files
Merge branch 'main' into sup43-condebug
2 parents 58db0d7 + cfe8834 commit e490b0e

File tree

25 files changed

+1358
-233
lines changed

25 files changed

+1358
-233
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"gmodnet.versiontool": {
6-
"version": "0.2.0-alpha.1.22426226.dev",
6+
"version": "2.0.0-alpha.1.41543664.main",
77
"commands": [
88
"gmodnet-vt"
99
]

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on: [push, pull_request]
44

55
env:
66
GMODNET_VERSION: '0.6.0'
7-
DOTNET_SDK_VERSION: '5.0.100'
7+
DOTNET_SDK_VERSION: '5.0.300'
88

99
jobs:
1010
linux-build:
1111

12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-20.04
1313

1414
steps:
1515
- name: Checkout
@@ -51,8 +51,16 @@ jobs:
5151
- name: Run Garry's Mod
5252
run: ./srcds_run_x64 -game garrysmod -systemtest -condebug +sv_hibernate_think 1 || true
5353
working-directory: ./gmod/
54-
timeout-minutes: 5
54+
timeout-minutes: 1
5555
continue-on-error: true
56+
env:
57+
COREHOST_TRACE: 1
58+
COREHOST_TRACE_VERBOSITY: 4
59+
COREHOST_TRACEFILE: corehost_trace.txt
60+
61+
- name: Print Corehost trace
62+
working-directory: ./gmod/
63+
run: cat corehost_trace.txt
5664

5765
- name: Print test log
5866
run: cat gmod/tests-log.txt
@@ -281,7 +289,7 @@ jobs:
281289

282290
deploy-and-notify:
283291

284-
runs-on: ubuntu-latest
292+
runs-on: ubuntu-18.04
285293

286294
needs: [linux-build, windows-build, mac-build]
287295

docfx_project/api-fusion/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# GmodDotNet API Documentation
2+
GmodDotNet consists of two main components: [GmodNET.API package](https://www.nuget.org/packages/GmodNET.API/), a .NET library which contains methods, types, and interfaces needed for writing Garry's Mod modules, and core GmodDotNet runtime, which supports, manages, and loads .NET modules directly into the game process.
3+
4+
Thus GmodDotNet documentation covers two public API layers:
5+
6+
1) [Docs for GmodNET.API](/api/GmodNET.API.html) .NET library.
7+
8+
2) [Docs for dotnet Lua library](/lua-api/dotnet.html) exposed by the core GmodDotNet runtime to manage modules (load and unload them).

docfx_project/api-fusion/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: .NET API
2+
href: ../api/toc.yml
3+
- name: Lua API
4+
href: ../lua-api/toc.yml

docfx_project/docfx.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@
2929
"toc.yml",
3030
"*.md"
3131
]
32+
},
33+
{
34+
"files": [
35+
"api-fusion/**.md",
36+
"api-fusion/**.yml"
37+
]
38+
},
39+
{
40+
"files": [
41+
"lua-api/**.md",
42+
"lua-api/**.yml"
43+
]
3244
}
3345
],
3446
"resource": [
@@ -51,6 +63,10 @@
5163
],
5264
"dest": "_site",
5365
"globalMetadataFiles": [],
66+
"globalMetadata": {
67+
"_appLogoPath": "images/gmodnetlogo-50px.png",
68+
"_appFaviconPath": "images/favicon.ico"
69+
},
5470
"fileMetadataFiles": [],
5571
"template": [
5672
"default",
@@ -61,6 +77,9 @@
6177
"noLangKeyword": false,
6278
"keepFileLink": false,
6379
"cleanupCacheHistory": false,
64-
"disableGitFeatures": false
80+
"disableGitFeatures": false,
81+
"xrefService": [
82+
"https://xref.docs.microsoft.com/query?uid={uid}"
83+
]
6584
}
6685
}

docfx_project/images/favicon.ico

15 KB
Binary file not shown.
1.24 KB
Loading

docfx_project/index.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# This is the **HOMEPAGE**.
2-
Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
3-
## Quick Start Notes:
4-
1. Add images to the *images* folder if the file is referencing an image.
1+
# GmodDotNet documentation
2+
3+
This is an early preview of the GmodDotNet documentation. Work is still in progress.

docfx_project/lua-api/dotnet.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# dotnet
2+
The Lua library to interact with the GmodDotNet runtime.
3+
This library is added to the Lua global scope after GmodDotNet runtime is loaded to the game with
4+
`require("dotnet")` (see [require](https://wiki.facepunch.com/gmod/Global.require) for more info).
5+
6+
## Functions
7+
8+
### load(string)
9+
Loads a GmodDotNet module by its name.
10+
11+
##### Declaration
12+
```lua
13+
boolean dotnet.load(string module_name)
14+
```
15+
16+
##### Parameters
17+
| Type | Name | Description |
18+
|------|------|-------------|
19+
| [string](https://wiki.facepunch.com/gmod/string) | module_name | A name of the module to load |
20+
21+
##### Returns
22+
| Type | Description |
23+
|------|-------------|
24+
| [boolean](https://wiki.facepunch.com/gmod/boolean) | `True`, if the module was loaded successfully, `False` otherwise.|
25+
26+
##### Remarks
27+
Loads a GmodDotNet module at path `[garrys mod (or dedicated server) root folder]/garrysmod/lua/bin/Modules/[module name]/[module name].dll`.
28+
29+
Module must be accompanied by all its dependencies and `[module name].deps.json` file.
30+
In practice it means that folder `[garrys mod root folder]/garrysmod/lua/bin/Modules/[module name]` must contain the full output of [`dotnet publish`](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish) operation of dotnet sdk.
31+
32+
If GmodDotNet runtime is not able to load the module, the function will return `False`, and the error message will be printed to a game console.
33+
34+
### unload(string)
35+
Unloads a GmodDotNet module by its name.
36+
37+
##### Declaration
38+
```lua
39+
boolean dotnet.unload(string module_name)
40+
```
41+
42+
##### Parameters
43+
| Type | Name | Description |
44+
|------|------|-------------|
45+
| [string](https://wiki.facepunch.com/gmod/string) | module_name | A name of the module to unload |
46+
47+
##### Returns
48+
| Type | Description |
49+
|------|-------------|
50+
| [boolean](https://wiki.facepunch.com/gmod/boolean) | `True`, if the module was unloaded successfully, `False` otherwise.|
51+
52+
##### Remarks
53+
If GmodDotNet runtime is not able to unload the module (exception was thrown while unloading, module is not able to free its resources, module with given name is not loaded, etc.), the function will return `False`, and the error message will be printed to a game console.

docfx_project/lua-api/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: GmodDotNet
2+
items:
3+
- name: dotnet
4+
href: dotnet.md

0 commit comments

Comments
 (0)