Exemplo n.º 1
0
 public SQLiteExtension(ExtensionManager manager) : base(manager)
 {
     if (Environment.OSVersion.Platform == PlatformID.Unix)
     {
         var extDir = Interface.Oxide.ExtensionDirectory;
         File.WriteAllText(Path.Combine(extDir, "System.Data.SQLite.dll.config"), $"<configuration>\n<dllmap dll=\"sqlite3\" target=\"{extDir}/x86/libsqlite3.so\" os=\"linux\" cpu=\"x86\" />\n<dllmap dll=\"sqlite3\" target=\"{extDir}/x64/libsqlite3.so\" os=\"linux\" cpu=\"x86-64\" />\n</configuration>");
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the PythonExtension class
 /// </summary>
 /// <param name="manager"></param>
 public PythonExtension(ExtensionManager manager)
     : base(manager)
 {
     var assem = AppDomain.CurrentDomain.GetAssemblies().Where(assembly => assembly.GetName().Name == "IronPython" || assembly.GetName().Name == "Microsoft.Scripting");
     var types = assem.SelectMany(Utility.GetAllTypesFromAssembly).Where(t => t.IsSubclassOf(typeof (Exception)));
     foreach (var type in types)
     {
         ExceptionHandler.RegisterType(type, ex => PythonEngine.GetService<ExceptionOperations>().FormatException(ex));
     }
     ExceptionHandler.RegisterType(typeof(SyntaxErrorException), ex => PythonEngine.GetService<ExceptionOperations>().FormatException(ex));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the LuaExtension class
 /// </summary>
 /// <param name="manager"></param>
 public LuaExtension(ExtensionManager manager)
     : base(manager)
 {
     ExceptionHandler.RegisterType(typeof(LuaScriptException), ex =>
     {
         var luaex = (LuaScriptException) ex;
         var outEx = luaex.IsNetException ? luaex.InnerException : luaex;
         var match = Regex.Match(string.IsNullOrEmpty(luaex.Source) ? luaex.Message : luaex.Source, @"\[string ""(.+)""\]:(\d+): ");
         if (match.Success)
             return string.Format("File: {0} Line: {1} {2}:{3}{4}", match.Groups[1], match.Groups[2], outEx.Message.Replace(match.Groups[0].Value, ""), Environment.NewLine, outEx.StackTrace);
         return string.Format("{0}{1}:{2}{3}", luaex.Source, outEx.Message, Environment.NewLine, outEx.StackTrace);
     });
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the JavaScript class
 /// </summary>
 /// <param name="manager"></param>
 public JavaScriptExtension(ExtensionManager manager)
     : base(manager)
 {
     ExceptionHandler.RegisterType(typeof(JavaScriptException), ex =>
     {
         var jintEx = (JavaScriptException) ex;
         var obj = jintEx.Error.ToObject() as ErrorInstance;
         if (obj != null) return string.Format("File: {0} Line: {1} Column: {2} {3} {4}:{5}{6}", jintEx.Location.Source, jintEx.LineNumber, jintEx.Column, obj.Get("name").AsString(), obj.Get("message").AsString(), Environment.NewLine, jintEx.StackTrace);
         return string.Format("File: {0} Line: {1} Column: {2} {3}:{4}{5}", jintEx.Location.Source, jintEx.LineNumber, jintEx.Column, jintEx.Message, Environment.NewLine, jintEx.StackTrace);
     });
     ExceptionHandler.RegisterType(typeof(ParserException), ex =>
     {
         var parserEx = (ParserException)ex;
         return string.Format("File: {0} Line: {1} Column: {2} {3}:{4}{5}", parserEx.Source, parserEx.LineNumber, parserEx.Column, parserEx.Description, Environment.NewLine, parserEx.StackTrace);
     });
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the JavaScriptExtension class
 /// </summary>
 /// <param name="manager"></param>
 public JavaScriptExtension(ExtensionManager manager)
     : base(manager)
 {
     ExceptionHandler.RegisterType(typeof(JavaScriptException), ex =>
     {
         var jintEx = (JavaScriptException) ex;
         var obj = jintEx.Error.ToObject() as ErrorInstance;
         if (obj != null) return $"File: {jintEx.Location.Source} Line: {jintEx.LineNumber} Column: {jintEx.Column} {obj.Get("name").AsString()} {obj.Get("message").AsString()}:{Environment.NewLine}{jintEx.StackTrace}";
         return $"File: {jintEx.Location.Source} Line: {jintEx.LineNumber} Column: {jintEx.Column} {jintEx.Message}:{Environment.NewLine}{jintEx.StackTrace}";
     });
     ExceptionHandler.RegisterType(typeof(ParserException), ex =>
     {
         var parserEx = (ParserException)ex;
         return $"File: {parserEx.Source} Line: {parserEx.LineNumber} Column: {parserEx.Column} {parserEx.Description}:{Environment.NewLine}{parserEx.StackTrace}";
     });
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the LuaExtension class
 /// </summary>
 /// <param name="manager"></param>
 public LuaExtension(ExtensionManager manager) : base(manager)
 {
     if (Environment.OSVersion.Platform == PlatformID.Unix)
     {
         var extDir = Interface.Oxide.ExtensionDirectory;
         File.WriteAllText(Path.Combine(extDir, "KeraLua.dll.config"), $"<configuration>\n<dllmap dll=\"lua52\" target=\"{extDir}/x86/liblua52.so\" os=\"linux\" cpu=\"x86\" />\n<dllmap dll=\"lua52\" target=\"{extDir}/x64/liblua52.so\" os=\"linux\" cpu=\"x86-64\" />\n</configuration>");
     }
     ExceptionHandler.RegisterType(typeof(LuaScriptException), ex =>
     {
         var luaex = (LuaScriptException) ex;
         var outEx = luaex.IsNetException ? luaex.InnerException : luaex;
         var match = Regex.Match(string.IsNullOrEmpty(luaex.Source) ? luaex.Message : luaex.Source, @"\[string ""(.+)""\]:(\d+): ");
         if (match.Success) return $"File: {match.Groups[1]} Line: {match.Groups[2]} {outEx.Message.Replace(match.Groups[0].Value, "")}:{Environment.NewLine}{outEx.StackTrace}";
         return $"{luaex.Source}{outEx.Message}:{Environment.NewLine}{outEx.StackTrace}";
     });
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the CSharpExtension class
 /// </summary>
 /// <param name="manager"></param>
 public CSharpExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the ReignOfKingsExtension class
 /// </summary>
 /// <param name="manager"></param>
 public ReignOfKingsExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the BeastsOfPreyExtension class
 /// </summary>
 /// <param name="manager"></param>
 public BeastsOfPreyExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the RustExtension class
 /// </summary>
 /// <param name="manager"></param>
 public RustLegacyExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the InterstellarRiftExtension class
 /// </summary>
 /// <param name="manager"></param>
 public InterstellarRiftExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 12
0
 public MySqlExtension(ExtensionManager manager) : base(manager)
 {
 }
Exemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the FromTheDepthsExtension class
 /// </summary>
 /// <param name="manager"></param>
 public FromTheDepthsExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the TerrariaExtension class
 /// </summary>
 /// <param name="manager"></param>
 public TerrariaExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the HurtworldExtension class
 /// </summary>
 /// <param name="manager"></param>
 public HurtworldExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the UnityExtension class
 /// </summary>
 /// <param name="manager"></param>
 public UnityExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the FortressCraftExtension class
 /// </summary>
 /// <param name="manager"></param>
 public FortressCraftExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the NomadExtension class
 /// </summary>
 /// <param name="manager"></param>
 public NomadExtension(ExtensionManager manager) : base(manager)
 {
 }
Exemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the UnturnedExtension class
 /// </summary>
 /// <param name="manager"></param>
 public UnturnedExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 20
0
 /// <summary>
 /// Initializes a new instance of the BlockstormExtension class
 /// </summary>
 /// <param name="manager"></param>
 public BlockstormExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 21
0
 public SQLiteExtension(ExtensionManager manager) : base(manager)
 {
 }
Exemplo n.º 22
0
 /// <summary>
 /// Initializes a new instance of the DeadLingerExtension class
 /// </summary>
 /// <param name="manager"></param>
 public DeadLingerExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 23
0
 /// <summary>
 /// Initializes a new instance of the SevenDaysExtension class
 /// </summary>
 /// <param name="manager"></param>
 public SevenDaysExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 24
0
 /// <summary>
 /// Initializes a new instance of the SavageLandsExtension class
 /// </summary>
 /// <param name="manager"></param>
 public SavageLandsExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 25
0
 /// <summary>
 /// Initializes a new instance of the TheForestExtension class
 /// </summary>
 /// <param name="manager"></param>
 public TheForestExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance of the ElseHeartBreakExtension class
 /// </summary>
 /// <param name="manager"></param>
 public ElseHeartBreakExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 27
0
 /// <summary>
 /// Initializes a new instance of the UE4Extension class
 /// </summary>
 /// <param name="manager"></param>
 public UE4Extension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 28
0
 /// <summary>
 /// Initializes a new instance of the RustExtension class
 /// </summary>
 /// <param name="manager"></param>
 public RustExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 29
0
 /// <summary>
 /// Initializes a new instance of the SpaceEngineersExtension class
 /// </summary>
 /// <param name="manager"></param>
 public SpaceEngineersExtension(ExtensionManager manager)
     : base(manager)
 {
 }
Exemplo n.º 30
0
 /// <summary>
 /// Initializes a new instance of the HideHoldOutExtension class
 /// </summary>
 /// <param name="manager"></param>
 public HideHoldOutExtension(ExtensionManager manager) : base(manager)
 {
 }