Newtonsoft.Json added. CoopSerializer updated. Bugfix for ModPackets. Interface renamed to COOPAPI. SendDataToServer() and GetLocalUsername() added

This commit is contained in:
EntenKoeniq
2021-11-27 22:44:00 +01:00
parent ebed2aaeb0
commit 2836953d89
9 changed files with 62 additions and 62 deletions

View File

@ -10,6 +10,11 @@ using Lidgren.Network;
namespace CoopServer
{
public abstract class ServerScript
{
public API API { get; } = new();
}
internal class Resource
{
private static Thread _mainThread;
@ -59,7 +64,7 @@ namespace CoopServer
Task<bool> task = new(() => _script.API.InvokeModPacketReceived(from, target, mod, customID, bytes));
task.Start();
task.Wait(5000);
return task.Result;
}
@ -92,7 +97,7 @@ namespace CoopServer
Task<bool> task = new(() => _script.API.InvokeChatMessage(username, message));
task.Start();
task.Wait(5000);
return task.Result;
}
@ -121,11 +126,6 @@ namespace CoopServer
}
}
public abstract class ServerScript
{
public API API { get; } = new();
}
public class API
{
#region DELEGATES