Some works for the new resource system

Rewrite some parts of CustomEvent
Expose some API as dll entry
This commit is contained in:
Sardelka9515
2023-02-01 21:21:07 +08:00
parent d4df041c44
commit f1b9bf0571
23 changed files with 558 additions and 223 deletions

View File

@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Runtime.InteropServices;
using System.Threading;
using GTA;
using Lidgren.Network;
@ -30,7 +31,7 @@ namespace RageCoop.Client.Scripting
/// <summary>
/// Provides vital functionality to interact with RAGECOOP
/// </summary>
public static class API
public static unsafe partial class API
{
#region INTERNAL
@ -270,6 +271,7 @@ namespace RageCoop.Client.Scripting
/// <summary>
/// Disconnect from current server or cancel the connection attempt.
/// </summary>
[UnmanagedCallersOnly(EntryPoint = "Disconnect")]
public static void Disconnect()
{
if (Networking.IsOnServer || Networking.IsConnecting) Networking.ToggleConnection(null);
@ -369,9 +371,9 @@ namespace RageCoop.Client.Scripting
};
DownloadManager.DownloadCompleted += handler;
Networking.GetResponse<Packets.FileTransferResponse>(new Packets.FileTransferRequest
{
Name = name
},
{
Name = name
},
p =>
{
if (p.Response != FileResponse.Loaded)