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; }
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!"); }