This commit is contained in:
PhoenixARC
2021-08-09 19:05:20 -04:00
parent 6b68cb9b97
commit 10f1c8daa0
320 changed files with 23614 additions and 2195 deletions
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace stonevox.Mod
{
public class Alias
{
public string name;
public FileReference file;
}
public class FunctionAlias
{
public enum endpoint
{
client,
server
}
public string name;
public FileReference controller;
public endpoint enpoint;
}
}
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace stonevox.Mod
{
public class FileReference
{
public string file { get; }
public FileReference(string file)
{
this.file = file;
}
}
}
@@ -0,0 +1,88 @@
using Ionic.Zip;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace stonevox.Mod
{
public class Manifest
{
public class info
{
public string name { get; set; }
public string version { get; set; }
}
public class game
{
public FileReference[] script;
}
public FileReference client_init_script;
public FileReference server_init_script;
public List<Alias> aliases;
// don't need the other stuff now, will add
Manifest()
{
aliases = new List<Alias>();
}
Manifest(string modDirectory)
: this()
{
if (Directory.Exists(modDirectory))
{
if (File.Exists(Path.Combine(modDirectory , "manifest.json")))
{
}
else
throw new Exception("No Manifest File found.");
}
else
throw new Exception("Expecting a folder path.");
}
Manifest(ZipFile file)
: this()
{
}
void LoadFromFile(string manifestPath)
{
}
void LoadFromZip(ZipEntry manifestEntry)
{
}
public static Manifest FromDirectory(string modDirectory)
{
return new Manifest(modDirectory);
}
public static Manifest FromSMOD(string smodPath)
{
if (File.Exists(smodPath))
{
if (ZipFile.IsZipFile(smodPath))
{
ZipFile zip = ZipFile.Read(smodPath);
return new Manifest(zip);
}
else
throw new Exception("Not a valid .smod");
}
else
throw new Exception("Expecting *.smod at path, but found nothing");
}
}
}
@@ -0,0 +1,16 @@
using Ionic.Zip;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace stonevox.Mod
{
public class StoneHearthMod
{
public string path { get; }
private ZipFile zip;
}
}