Skip to content

Commit 02bd631

Browse files
committed
Merge branch 'development'
2 parents 7bcebd6 + f9e3dcc commit 02bd631

File tree

12 files changed

+156
-246
lines changed

12 files changed

+156
-246
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ on:
77
- development
88
paths-ignore:
99
- '**.md'
10+
- 'docs/**'
1011
pull_request:
1112
branches:
1213
- master
1314
- development
1415
paths-ignore:
1516
- '**.md'
17+
- 'docs/**'
1618
workflow_dispatch:
1719
inputs:
1820
tag:

NWN.Anvil.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2020
<EnableDynamicLoading>true</EnableDynamicLoading>
2121
<IncludeSymbols>true</IncludeSymbols>
22+
<DebugSymbols>true</DebugSymbols>
2223
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2324
<RepositoryUrl>https://github.com/nwn-dotnet/Anvil</RepositoryUrl>
2425
<RepositoryType>git</RepositoryType>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ Checking in the console or server logs, you should get the following output:
122122
## Core Services
123123
Anvil is bundled with a core set of services that you can depend on in your own plugins and systems.
124124

125-
These services handle game events, task scheduling, and more! Examples of how to use these services can be found in the [Anvil docs](https://nwn-dotnet.github.io/Anvil/classNWN_1_1Services_1_1ServiceBindingAttribute.html#details).
125+
These services handle game events, task scheduling, and more! Examples of how to use these services can be found in the [Anvil docs](https://nwn-dotnet.github.io/Anvil/classAnvil_1_1Services_1_1ServiceBindingAttribute.html).
126126

127-
You can also find a full list of the services bundled by Anvil [HERE](https://nwn-dotnet.github.io/Anvil/namespaceNWN_1_1Services.html).
127+
You can also find a full list of the services bundled by Anvil [HERE](https://nwn-dotnet.github.io/Anvil/namespaceAnvil_1_1Services.html).

docs/Doxyfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Project related configuration options
55
#---------------------------------------------------------------------------
66
DOXYFILE_ENCODING = UTF-8
7-
PROJECT_NAME = "NWN.Managed"
7+
PROJECT_NAME = "Anvil"
88
PROJECT_NUMBER =
99
PROJECT_BRIEF =
1010
PROJECT_LOGO =
@@ -82,10 +82,10 @@ SHOW_GROUPED_MEMB_INC = NO
8282
FORCE_LOCAL_INCLUDES = NO
8383
INLINE_INFO = YES
8484
SORT_MEMBER_DOCS = YES
85-
SORT_BRIEF_DOCS = NO
86-
SORT_MEMBERS_CTORS_1ST = NO
85+
SORT_BRIEF_DOCS = YES
86+
SORT_MEMBERS_CTORS_1ST = YES
8787
SORT_GROUP_NAMES = YES
88-
SORT_BY_SCOPE_NAME = NO
88+
SORT_BY_SCOPE_NAME = YES
8989
STRICT_PROTO_MATCHING = NO
9090
GENERATE_TODOLIST = YES
9191
GENERATE_TESTLIST = YES
@@ -209,7 +209,7 @@ HTML_COLORSTYLE_SAT = 100
209209
HTML_COLORSTYLE_GAMMA = 80
210210
HTML_TIMESTAMP = NO
211211
HTML_DYNAMIC_SECTIONS = YES
212-
HTML_INDEX_NUM_ENTRIES = 100
212+
HTML_INDEX_NUM_ENTRIES = 0
213213
GENERATE_DOCSET = NO
214214
DOCSET_FEEDNAME = "Doxygen generated docs"
215215
DOCSET_BUNDLE_ID = org.doxygen.Project
@@ -221,7 +221,7 @@ HHC_LOCATION =
221221
GENERATE_CHI = NO
222222
CHM_INDEX_ENCODING =
223223
BINARY_TOC = NO
224-
TOC_EXPAND = NO
224+
TOC_EXPAND = YES
225225
GENERATE_QHP = NO
226226
QCH_FILE =
227227
QHP_NAMESPACE = org.doxygen.Project

docs/DoxygenLayout.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- Navigation index tabs for HTML output -->
44
<navindex>
55
<tab type="mainpage" visible="yes" title=""/>
6-
<tab type="classlist" visible="yes" title="API" intro=""/>
6+
<tab type="classlist" visible="yes" title="API Reference" intro=""/>
77
</navindex>
88

99
<!-- Layout definition for a class page -->
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Threading;
4+
using Anvil.Services;
5+
using NLog;
6+
7+
namespace Anvil.API
8+
{
9+
[ServiceBinding(typeof(MainThreadSynchronizationContext))]
10+
[ServiceBinding(typeof(IUpdateable))]
11+
[ServiceBindingOptions(BindingOrder.API)]
12+
public sealed class MainThreadSynchronizationContext : SynchronizationContext, IUpdateable, IAwaitable
13+
{
14+
private static readonly Logger Log = LogManager.GetCurrentClassLogger();
15+
16+
private readonly List<QueuedTask> queuedTasks = new List<QueuedTask>();
17+
private readonly List<QueuedTask> currentWork = new List<QueuedTask>();
18+
19+
void IUpdateable.Update()
20+
{
21+
lock (queuedTasks)
22+
{
23+
currentWork.AddRange(queuedTasks);
24+
queuedTasks.Clear();
25+
}
26+
27+
try
28+
{
29+
foreach (QueuedTask task in currentWork)
30+
{
31+
task.Invoke();
32+
}
33+
}
34+
catch (Exception e)
35+
{
36+
Log.Error(e);
37+
}
38+
finally
39+
{
40+
currentWork.Clear();
41+
}
42+
}
43+
44+
public override void Post(SendOrPostCallback callback, object state)
45+
{
46+
lock (queuedTasks)
47+
{
48+
queuedTasks.Add(new QueuedTask(callback, state));
49+
}
50+
}
51+
52+
public override void Send(SendOrPostCallback callback, object state)
53+
{
54+
lock (queuedTasks)
55+
{
56+
queuedTasks.Add(new QueuedTask(callback, state));
57+
}
58+
}
59+
60+
public IAwaiter GetAwaiter()
61+
{
62+
return new SynchronizationContextAwaiter(this);
63+
}
64+
65+
private readonly struct QueuedTask
66+
{
67+
private readonly SendOrPostCallback callback;
68+
private readonly object state;
69+
70+
public QueuedTask(SendOrPostCallback callback, object state)
71+
{
72+
this.callback = callback;
73+
this.state = state;
74+
}
75+
76+
public void Invoke()
77+
{
78+
try
79+
{
80+
callback(state);
81+
}
82+
catch (Exception e)
83+
{
84+
Log.Error(e);
85+
}
86+
}
87+
}
88+
}
89+
}

src/main/Anvil/API/Async/NwTask.Runner.cs

Lines changed: 0 additions & 113 deletions
This file was deleted.

src/main/Anvil/API/Async/NwTask.SyncContext.cs

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)