mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-09-30 02:38:09 +03:00
add instance metrics to server
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
@@ -13,6 +14,10 @@ public static class DllMain
|
||||
{
|
||||
private const string WebAddress = "http://card.ppc.moe";
|
||||
|
||||
// instance metrics
|
||||
internal static long LastPollTime = -1;
|
||||
internal static long ServerStartedAt;
|
||||
|
||||
static DllMain()
|
||||
{
|
||||
PInvoke.AllocConsole();
|
||||
@@ -38,6 +43,7 @@ public static class DllMain
|
||||
cancellationRegistration?.Dispose();
|
||||
});
|
||||
|
||||
Volatile.Write(ref ServerStartedAt, Environment.TickCount64);
|
||||
App.RunAsync();
|
||||
return 0;
|
||||
}
|
||||
@@ -45,6 +51,8 @@ public static class DllMain
|
||||
[UnmanagedCallersOnly(EntryPoint = "aime_io_nfc_poll")]
|
||||
public static int NfcPoll(byte unitNo)
|
||||
{
|
||||
Volatile.Write(ref LastPollTime, Environment.TickCount64);
|
||||
|
||||
if (!Config.EnableAimeTxt)
|
||||
{
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user