forked from zombieb/undead-universal-patch-il2cpp
30 lines
889 B
C#
30 lines
889 B
C#
using System.Collections.Generic;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP;
|
|
using undead_universal_patch_il2cpp.Patches.UndeadGameManager;
|
|
using UnityEngine;
|
|
|
|
namespace undead_universal_patch_il2cpp.Core.Content.CustomRecNet.CustomGameManager;
|
|
|
|
public class CustomFreeSpawns : MonoBehaviour
|
|
{
|
|
public void Start()
|
|
{
|
|
RecNetInteractions.postAuthenticationActions.Add(DownloadFreeSpawns);
|
|
}
|
|
|
|
public void OnFailed([Optional] HTTPResponse res)
|
|
{
|
|
Util.ConditionalDebug($"CustomFreeSpawns failed: HTTP Error {res.StatusCode}");
|
|
}
|
|
|
|
public void Finished(HTTPResponse res, List<string> spawns)
|
|
{
|
|
FreeSpawnsPatch_Array.spawns = spawns;
|
|
}
|
|
|
|
public void DownloadFreeSpawns()
|
|
{
|
|
RecNetInteractions.SendRequest<List<string>>(HTTPMethods.Get, RecNet.Service.API, "/api/undead/v1/freespawns", Finished, OnFailed);
|
|
}
|
|
} |