Skip to content

Commit 98a8c8d

Browse files
markatkMicky5991
authored andcommitted
Change bridge dll to executable and add main entry point
1 parent 5c7b31f commit 98a8c8d

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

clrhost/src/clrHost.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ bool ClrHost::load() {
7676
return false;
7777
}
7878

79-
if (_mainCallback == nullptr && getDelegate("Main", (void **)&_mainCallback) == false) {
79+
if (_mainCallback == nullptr && getDelegate("PluginMain", (void **) &_mainCallback) == false) {
8080
return false;
8181
}
8282

@@ -203,15 +203,16 @@ bool ClrHost::createAppDomain() {
203203
}
204204

205205
// execute assembly to set a valid entry point which is needed by some libraries as mysql
206-
auto libraryPath = getAbsolutePath(std::string(PLUGIN_DIR_PATH) + PLUGIN_NAME);
206+
unsigned int exitCode = 0;
207+
auto libraryPath = getAbsolutePath(std::string(PLUGIN_DIR_PATH) + PLUGIN_NAME + ".dll");
207208

208209
result = _executeAssembly(
209210
_runtimeHost,
210211
_domainId,
211212
0,
212213
nullptr,
213214
libraryPath.c_str(),
214-
nullptr
215+
&exitCode
215216
);
216217

217218
if (result < 0) {

src/AlternateLife.RageMP.Net/AlternateLife.RageMP.Net.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<RepositoryUrl>https://github.com/AlternateLife/RageMP.Net/</RepositoryUrl>
1515
<RepositoryType>git</RepositoryType>
1616
<PackageTags>ragemp gta bridge</PackageTags>
17+
<OutputType>Exe</OutputType>
1718
</PropertyGroup>
1819

1920
<PropertyGroup Condition=" '$(Configuration)' == 'Testing' ">

src/AlternateLife.RageMP.Net/PluginWrapper.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ namespace AlternateLife.RageMP.Net
88
{
99
internal static class PluginWrapper
1010
{
11-
public static void Main(IntPtr multiplayer)
11+
public static void Main()
12+
{
13+
}
14+
15+
public static void PluginMain(IntPtr multiplayer)
1216
{
1317
var plugin = new Plugin(multiplayer);
1418

0 commit comments

Comments
 (0)