Пример #1
0
        public void TryRegisterSourceFromOsuRTDataProvider(SyncHost host)
        {
            foreach (var plugin in host.EnumPluings())
            {
                if (plugin.Name == "OsuRTDataProvider")
                {
                    Log.Output(OSURTDP_FOUND);
                    OsuRTDataProvider.OsuRTDataProviderPlugin reader = plugin as OsuRTDataProvider.OsuRTDataProviderPlugin;

                    if (reader.ModsChangedAtListening)
                    {
                        SourceWrapper = new RealtimeDataProviderModsWrapper(reader, this);
                    }
                    else
                    {
                        SourceWrapper = new OsuRTDataProviderWrapper(reader, this);
                    }

                    if (SourceWrapper.Attach())
                    {
                        source = UsingSource.OsuRTDataProvider;
                    }

                    return;
                }
            }

            Log.Error(OSURTDP_NOTFOUND);

            source = UsingSource.None;
        }
Пример #2
0
        public void TryRegisterSourceFromOsuRTDataProvider(SyncHost host)
        {
            foreach (var plugin in host.EnumPluings())
            {
                if (plugin.Name == "OsuRTDataProvider")
                {
                    Logger.LogInfomation("OsuRTDataProvider plugin found!");
                    OsuRTDataProvider.OsuRTDataProviderPlugin reader = plugin as OsuRTDataProvider.OsuRTDataProviderPlugin;
                    ReflectorModel.ORTDP = reader;

                    ReflectorModel.ORTDP.ListenerManager.OnPlayerChanged  += OnPlayerChanged;
                    ReflectorModel.ORTDP.ListenerManager.OnStatusChanged  += OnStatusChange;
                    ReflectorModel.ORTDP.ListenerManager.OnModsChanged    += OnCurrentModsChange;
                    ReflectorModel.ORTDP.ListenerManager.OnBeatmapChanged += OnCurrentBeatmapChange;
                    ReflectorModel.ORTDP.ListenerManager.OnScoreChanged   += OnScoreChanged;
                    OsuUserName = Setting.UserName;
                    return;
                }
            }

            Logger.Error("OsuRTDataProvider plugin not found!");
        }
Пример #3
0
        public void TryRegisterSourceFromDifficultParamModifyPlugin(SyncHost host)
        {
            foreach (var plugin in host.EnumPluings())
            {
                if (plugin.Name == "DifficultParamModifyPlugin")
                {
                    Log.Output($"发现dpmp插件");
                    DifficultParamModifyPlugin.DifficultParamModifyPlugin reader = plugin as DifficultParamModifyPlugin.DifficultParamModifyPlugin;

                    SourceWrapper = new DifficultParamModifyPluginSourceWrapper(reader, this);

                    if (SourceWrapper.Attach())
                    {
                        source = UsingSource.DifficultParamModifyPlugin;
                    }

                    return;
                }
            }

            Log.Error($"没发现dpmp插件");

            source = UsingSource.None;
        }