private void CreateManifest()
        {
            ManifestFile = Path.Combine(TempInstallFolder, Path.GetFileNameWithoutExtension(FileName) + ".dnn");
            StreamWriter manifestWriter = new StreamWriter(ManifestFile);

            manifestWriter.Write(LegacyUtil.CreateSkinManifest(FileName, rblLegacySkin.SelectedValue, TempInstallFolder));
            manifestWriter.Close();
        }
示例#2
0
        private static string CreateManifest(Installer installer, string fileName, string legacySkin)
        {
            var manifestFile = Path.Combine(installer.TempInstallFolder, Path.GetFileNameWithoutExtension(fileName) + ".dnn");

            using (var manifestWriter = new StreamWriter(manifestFile))
            {
                manifestWriter.Write(LegacyUtil.CreateSkinManifest(fileName, legacySkin ?? "Skin", installer.TempInstallFolder));
                manifestWriter.Close();
            }
            return(manifestFile);
        }
 public ModulePackageWriter(XPathNavigator manifestNav, InstallerInfo installer)
 {
     _DesktopModule = new DesktopModuleInfo();
     Package        = new PackageInfo(installer);
     ReadLegacyManifest(manifestNav, true);
     Package.Name         = DesktopModule.ModuleName;
     Package.FriendlyName = DesktopModule.FriendlyName;
     Package.Description  = DesktopModule.Description;
     if (!string.IsNullOrEmpty(DesktopModule.Version))
     {
         Package.Version = new Version(DesktopModule.Version);
     }
     Package.PackageType = "Module";
     LegacyUtil.ParsePackageName(Package);
     Initialize(DesktopModule.FolderName);
 }
        public ModulePackageWriter(XPathNavigator manifestNav, InstallerInfo installer)
        {
            this.DesktopModule = new DesktopModuleInfo();

            // Create a Package
            this.Package = new PackageInfo(installer);

            this.ReadLegacyManifest(manifestNav, true);

            this.Package.Name         = this.DesktopModule.ModuleName;
            this.Package.FriendlyName = this.DesktopModule.FriendlyName;
            this.Package.Description  = this.DesktopModule.Description;
            if (!string.IsNullOrEmpty(this.DesktopModule.Version))
            {
                this.Package.Version = new Version(this.DesktopModule.Version);
            }

            this.Package.PackageType = "Module";

            LegacyUtil.ParsePackageName(this.Package);

            this.Initialize(this.DesktopModule.FolderName);
        }
示例#5
0
        public void OnQueryAction(object sender, IrcEventArgs e)
        {
            Console.WriteLine($"[PM-ACTION] {e.Data.Nick} : {e.Data.Message}");

            // Check NowPlaying
            if (NowPlayingParser.IsNowPlaying(e.Data.Message))
            {
                NowPlaying np = NowPlayingParser.Parse(e.Data.Message);
                if (np.IsMapSet == true)
                {
                    new CommandResult()
                    {
                        Type   = CommandResultType.MESSAGE,
                        Result = "Sorry. We cannot calculate the mapset."
                    }.Send(irc, e.Data.Nick);
                    return;
                }
                try
                {
                    BanchoUserHistory c = HistoryCache.Get(e.Data.Nick);
                    if (c == null)
                    {
                        c = new BanchoUserHistory(np.Id);
                        HistoryCache.cache[e.Data.Nick] = c;
                    }
                    short _mode = np.Mode == 0 && c.RecentMode == 0 ? (short)0 : np.Mode;
                    if (np.NpType == NowPlayingType.LISTENING)
                    {
                        _mode = c.RecentMode;                         // There is no mode in text.
                    }

                    Calculator calc = LegacyUtil.GetCalculator(_mode, np.Id);
                    string[]   mods = np.Mods;
                    if (!calc.IsConvertable())
                    {
                        // Fallback Calculator
                        calc = LegacyUtil.GetCalculator((short)calc.Beatmap.BeatmapInfo.RulesetID, np.Id);
                    }

                    calc.Mod = Common.GetMods(mods, calc.Ruleset).ToArray();
                    CalculateMessage msg = new CalculateMessage(calc);
                    new CommandResult()
                    {
                        Type   = CommandResultType.MESSAGE,
                        Result = msg.ToString()
                    }.Send(irc, e.Data.Nick);

                    c.RecentBeatmapId = np.Id;
                    c.RecentMode      = np.Mode;
                    c.RecentMod       = new Mod[] { };
                }
                catch (Exception err)
                {
                    new CommandResult()
                    {
                        Type   = CommandResultType.MESSAGE,
                        Result = $"A Error found: {err.Message}"
                    }.Send(irc, e.Data.Nick);
                }
            }
            else if (e.Data.Message.StartsWith("\u0001ACTION is listening to "))
            {
                new CommandResult()
                {
                    Type   = CommandResultType.MESSAGE,
                    Result = "I'm sorry. We can't check/download the un-submitted map."
                }.Send(irc, e.Data.Nick);
            }
        }