Fix stuff
This commit is contained in:
@ -115,14 +115,14 @@ namespace RageCoop.Client.Installer
|
||||
UpdateStatus("Checking conflicts");
|
||||
var menyooConfig = Path.Combine(root, @"menyooStuff\menyooConfig.ini");
|
||||
var settingsPath = Path.Combine(root, SettingsPath);
|
||||
Settings settings = null;
|
||||
ClientSettings settings = null;
|
||||
try
|
||||
{
|
||||
settings = Util.ReadSettings(settingsPath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
settings = new Settings();
|
||||
settings = new();
|
||||
}
|
||||
|
||||
if (File.Exists(menyooConfig))
|
||||
|
@ -119,5 +119,10 @@ namespace RageCoop.Client.Scripting
|
||||
|
||||
[LibraryImport("RageCoop.Client.dll")]
|
||||
private static partial int GetLastResultLenInChars();
|
||||
|
||||
[LibraryImport("RageCoop.Client.dll")]
|
||||
[return: MarshalAs(UnmanagedType.I1)]
|
||||
public static partial bool RegisterCustomEventHandler(CustomEventHash hash, IntPtr ptrHandler);
|
||||
|
||||
}
|
||||
}
|
@ -1,9 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<OutDir>..\..\bin\API</OutDir>
|
||||
<DocumentationFile>..\..\bin\API\RageCoop.Client.Scripting.xml</DocumentationFile>
|
||||
<NoWarn>CS1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -236,7 +236,6 @@ namespace RageCoop.Client
|
||||
MainChat.OnKeyDown(e.KeyCode);
|
||||
return;
|
||||
}
|
||||
|
||||
#if CEF
|
||||
if (CefRunning)
|
||||
{
|
||||
|
@ -15,6 +15,7 @@
|
||||
<NoWarn>CS1591</NoWarn>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||
<GenerateDocumentationFile>False</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<TrimmerRootDescriptor Include="Trimming.xml" />
|
||||
|
@ -3,6 +3,7 @@ using RageCoop.Core;
|
||||
using RageCoop.Core.Scripting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection.Metadata;
|
||||
using System.Runtime.InteropServices;
|
||||
using static RageCoop.Core.Scripting.CustomEvents;
|
||||
|
||||
@ -85,6 +86,26 @@ namespace RageCoop.Client.Scripting
|
||||
[UnmanagedCallersOnly(EntryPoint = nameof(GetLastResultLenInChars))]
|
||||
public static int GetLastResultLenInChars() => _lastResult?.Length ?? 0;
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = nameof(RegisterCustomEventHandler))]
|
||||
public static bool RegisterCustomEventHandler(CustomEventHash hash, IntPtr ptrHandler)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (CustomEventHandlers)
|
||||
{
|
||||
if (!CustomEventHandlers.TryGetValue(hash, out var handlers))
|
||||
CustomEventHandlers.Add(hash, handlers = new());
|
||||
handlers.Add(new(ptrHandler));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(nameof(RegisterCustomEventHandler), ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert Entity ID to handle
|
||||
/// </summary>
|
||||
|
@ -183,7 +183,7 @@ namespace RageCoop.Client.Scripting
|
||||
/// Get the local player's ID
|
||||
/// </summary>
|
||||
/// <returns>PlayerID</returns>
|
||||
public static int LocalPlayerID => LocalPlayerID;
|
||||
public static int LocalPlayerID => Main.LocalPlayerID;
|
||||
|
||||
/// <summary>
|
||||
/// Check if player is connected to a server
|
||||
|
@ -197,7 +197,6 @@ namespace RageCoop.Client.Scripting
|
||||
return;
|
||||
}
|
||||
|
||||
var t = returnType;
|
||||
var id = (int)e.Args[1];
|
||||
|
||||
|
||||
|
@ -16,9 +16,6 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'API'">
|
||||
<OutDir>..\bin\API</OutDir>
|
||||
<Deterministic>true</Deterministic>
|
||||
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
|
||||
<ProduceOnlyReferenceAssembly>true</ProduceOnlyReferenceAssembly>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -27,10 +27,10 @@ namespace RageCoop.Core
|
||||
/// Shortcut to <see cref="BufferReader.ThreadLocal"/>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static unsafe BufferReader GetReader(byte* data=null,int cbData=0)
|
||||
public static unsafe BufferReader GetReader(byte* data = null, int cbData = 0)
|
||||
{
|
||||
var reader = BufferReader.ThreadLocal.Value;
|
||||
reader.Initialise(data,cbData);
|
||||
reader.Initialise(data, cbData);
|
||||
return reader;
|
||||
}
|
||||
|
||||
@ -39,8 +39,9 @@ namespace RageCoop.Core
|
||||
/// Shortcut to <see cref="BufferWriter.ThreadLocal"/>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static BufferWriter GetWriter(bool reset=true) {
|
||||
var writer=BufferWriter.ThreadLocal.Value;
|
||||
public static BufferWriter GetWriter(bool reset = true)
|
||||
{
|
||||
var writer = BufferWriter.ThreadLocal.Value;
|
||||
if (reset)
|
||||
{
|
||||
writer.Reset();
|
||||
|
@ -15,7 +15,7 @@ using System.Resources;
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Version information
|
||||
[assembly: AssemblyVersion("1.6.0.32")]
|
||||
[assembly: AssemblyFileVersion("1.6.0.32")]
|
||||
[assembly: AssemblyVersion("1.6.0.33")]
|
||||
[assembly: AssemblyFileVersion("1.6.0.33")]
|
||||
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
cd "%~dp0"
|
||||
git submodule update --init
|
||||
if exist "bin" rmdir /s /q "bin"
|
||||
dotnet build -c Release
|
||||
dotnet build -c API Core\RageCoop.Core.csproj
|
||||
dotnet build -c API Server\RageCoop.Server.csproj
|
||||
cd %~dp0
|
||||
copy .\Client\Scripts\obj\Release\ref\RageCoop.Client.dll .\bin\API\RageCoop.Client.dll /y
|
||||
dotnet build -c API Client\RageCoop.Client.Scripting.csproj
|
||||
del .\bin\API\RageCoop.Server.exe
|
||||
if exist .\bin\Release\Client\SubProcess rmdir .\bin\Release\Client\SubProcess /s /q
|
Reference in New Issue
Block a user