Guest User

Untitled

a guest
Apr 23rd, 2017
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.91 KB | None | 0 0
  1. namespace PluginSystem
  2. {
  3.     public class ChunkInfo
  4.     {
  5.         public string id;
  6.         public string toc;
  7.         public string bundle;
  8.         public byte[] sha1;
  9.         public ChunkInfo(string _id, string _toc, string _bundle, byte[] _sha1)
  10.         {
  11.             id = _id;
  12.             toc = _toc;
  13.             bundle = _bundle;
  14.             sha1 = _sha1;
  15.         }
  16.     }
  17.  
  18.     public class DataInfo
  19.     {
  20.         public int type; //0=ebx
  21.         public string path;
  22.         public string toc;
  23.         public string bundle;
  24.         public byte[] sha1;
  25.         public byte[] idata;
  26.         public DataInfo(int _type, string _path, string _toc, string _bundle, byte[] _sha1, byte[] _idata)
  27.         {
  28.             type = _type;
  29.             path = _path;
  30.             toc = _toc;
  31.             bundle = _bundle;
  32.             sha1 = _sha1;
  33.             idata = _idata;
  34.         }
  35.     }
  36.  
  37.     public interface IPlugin
  38.     {
  39.         IPluginHost Host { get; set; }
  40.         string Name { get; }
  41.         bool addToMainMenu { get; }
  42.         bool addToContextMenu { get; }
  43.         bool supportsAllResTypes { get; }
  44.         List<uint> supportedResTypes { get; }
  45.         void DoMain();
  46.         void DoContextData(DataInfo info);
  47.         string RunModJob(byte[] payload);
  48.     }
  49.  
  50.     public interface IPluginHost
  51.     {
  52.         List<string> getTOCFiles();
  53.         List<string> getTOCFileLabels();
  54.         List<string> getBundleNames(string toc);
  55.         List<DataInfo> getAllEBX(string toc, string bundle);
  56.         List<DataInfo> getAllRES(string toc, string bundle);
  57.         List<ChunkInfo> getAllTocCHUNKs(string toc);
  58.         List<ChunkInfo> getAllBundleCHUNKs(string toc, string bundle);
  59.         byte[] getDataBySha1(byte[] sha1);
  60.         int setDataBySha1(byte[] data, byte[] sha1, string toc);
  61.         void setAutoPatching(bool value);
  62.         void AddModJob(string pname, string desc, byte[] payload);
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment