Ejemplo n.º 1
0
		public void Setup(string ServerName, bool LoadConfig = false)
		{
			_servername = ServerName;
			sSCompiler = new SCompiler(ServerName);

			if(IRCConfig.List[ServerName].ServerId == 1 || LoadConfig)
				_config = new AddonConfig(Name, ".yml");

			sIrcBase.Networks[ServerName].IrcRegisterHandler("PRIVMSG", HandlePrivmsg);
			sSCompiler.EntryRegex = new Regex(@"class\s+" + CompilerConfig.MainClass + @"\s*{");
			sSCompiler.EntryAndAbstractRegex = new Regex(@"class\s+" + CompilerConfig.MainClass + @"\s*:\s*Schumix.Compiler.Abstract\s*{");
			sSCompiler.SchumixRegex = new Regex(@"(public\s+|)void\s+" + CompilerConfig.MainConstructor + @"\s*\(\s*\)\s*{");
			sSCompiler.SchumixAndOverrideRegex  = new Regex(@"public\s+override\s+void\s+" + CompilerConfig.MainConstructor + @"\s*\(\s*\)\s*{");
		}
Ejemplo n.º 2
0
		public int Reload(string RName, bool LoadConfig, string SName = "")
		{
			try
			{
				switch(RName.ToLower())
				{
					case "config":
						if(IRCConfig.List[_servername].ServerId == 1 || LoadConfig)
							_config = new AddonConfig(Name, ".yml");
						return 1;
				}
			}
			catch(Exception e)
			{
				Log.Error("CompilerAddon", sLConsole.GetString("Reload: ") + sLConsole.GetString("Failure details: {0}"), e.Message);
				return 0;
			}

			return -1;
		}