mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 16:43:52 +09:00
Merge branch 'master' into fix-participants-list
This commit is contained in:
@ -104,7 +104,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
|
|||||||
if (Attributes.ApproachRate > 10.33)
|
if (Attributes.ApproachRate > 10.33)
|
||||||
approachRateFactor += 0.4 * (Attributes.ApproachRate - 10.33);
|
approachRateFactor += 0.4 * (Attributes.ApproachRate - 10.33);
|
||||||
else if (Attributes.ApproachRate < 8.0)
|
else if (Attributes.ApproachRate < 8.0)
|
||||||
approachRateFactor += 0.1 * (8.0 - Attributes.ApproachRate);
|
approachRateFactor += 0.01 * (8.0 - Attributes.ApproachRate);
|
||||||
|
|
||||||
aimValue *= 1.0 + Math.Min(approachRateFactor, approachRateFactor * (totalHits / 1000.0));
|
aimValue *= 1.0 + Math.Min(approachRateFactor, approachRateFactor * (totalHits / 1000.0));
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
[TestCase("sample-to-type-conversions")]
|
[TestCase("sample-to-type-conversions")]
|
||||||
[TestCase("slider-conversion-v6")]
|
[TestCase("slider-conversion-v6")]
|
||||||
[TestCase("slider-conversion-v14")]
|
[TestCase("slider-conversion-v14")]
|
||||||
|
[TestCase("slider-generating-drumroll-2")]
|
||||||
public void Test(string name) => base.Test(name);
|
public void Test(string name) => base.Test(name);
|
||||||
|
|
||||||
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
||||||
|
@ -160,7 +160,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool shouldConvertSliderToHits(HitObject obj, IBeatmap beatmap, IHasDistance distanceData, out double taikoDuration, out double tickSpacing)
|
private bool shouldConvertSliderToHits(HitObject obj, IBeatmap beatmap, IHasDistance distanceData, out int taikoDuration, out double tickSpacing)
|
||||||
{
|
{
|
||||||
// DO NOT CHANGE OR REFACTOR ANYTHING IN HERE WITHOUT TESTING AGAINST _ALL_ BEATMAPS.
|
// DO NOT CHANGE OR REFACTOR ANYTHING IN HERE WITHOUT TESTING AGAINST _ALL_ BEATMAPS.
|
||||||
// Some of these calculations look redundant, but they are not - extremely small floating point errors are introduced to maintain 1:1 compatibility with stable.
|
// Some of these calculations look redundant, but they are not - extremely small floating point errors are introduced to maintain 1:1 compatibility with stable.
|
||||||
@ -185,7 +185,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
|
|
||||||
// The velocity and duration of the taiko hit object - calculated as the velocity of a drum roll.
|
// The velocity and duration of the taiko hit object - calculated as the velocity of a drum roll.
|
||||||
double taikoVelocity = sliderScoringPointDistance * beatmap.BeatmapInfo.BaseDifficulty.SliderTickRate;
|
double taikoVelocity = sliderScoringPointDistance * beatmap.BeatmapInfo.BaseDifficulty.SliderTickRate;
|
||||||
taikoDuration = distance / taikoVelocity * beatLength;
|
taikoDuration = (int)(distance / taikoVelocity * beatLength);
|
||||||
|
|
||||||
if (isForCurrentRuleset)
|
if (isForCurrentRuleset)
|
||||||
{
|
{
|
||||||
@ -200,7 +200,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
beatLength = timingPoint.BeatLength;
|
beatLength = timingPoint.BeatLength;
|
||||||
|
|
||||||
// If the drum roll is to be split into hit circles, assume the ticks are 1/8 spaced within the duration of one beat
|
// If the drum roll is to be split into hit circles, assume the ticks are 1/8 spaced within the duration of one beat
|
||||||
tickSpacing = Math.Min(beatLength / beatmap.BeatmapInfo.BaseDifficulty.SliderTickRate, taikoDuration / spans);
|
tickSpacing = Math.Min(beatLength / beatmap.BeatmapInfo.BaseDifficulty.SliderTickRate, (double)taikoDuration / spans);
|
||||||
|
|
||||||
return tickSpacing > 0
|
return tickSpacing > 0
|
||||||
&& distance / osuVelocity * 1000 < 2 * beatLength;
|
&& distance / osuVelocity * 1000 < 2 * beatLength;
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
{
|
{
|
||||||
"Mappings": [{
|
"Mappings": [
|
||||||
|
{
|
||||||
"StartTime": 2000,
|
"StartTime": 2000,
|
||||||
"Objects": [{
|
"Objects": [
|
||||||
|
{
|
||||||
"StartTime": 2000,
|
"StartTime": 2000,
|
||||||
"EndTime": 2000,
|
"EndTime": 2000,
|
||||||
"IsRim": false,
|
"IsRim": false,
|
||||||
@ -23,7 +25,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"StartTime": 4000,
|
"StartTime": 4000,
|
||||||
"Objects": [{
|
"Objects": [
|
||||||
|
{
|
||||||
"StartTime": 4000,
|
"StartTime": 4000,
|
||||||
"EndTime": 4000,
|
"EndTime": 4000,
|
||||||
"IsRim": false,
|
"IsRim": false,
|
||||||
@ -45,7 +48,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"StartTime": 6000,
|
"StartTime": 6000,
|
||||||
"Objects": [{
|
"Objects": [
|
||||||
|
{
|
||||||
"StartTime": 6000,
|
"StartTime": 6000,
|
||||||
"EndTime": 6000,
|
"EndTime": 6000,
|
||||||
"IsRim": true,
|
"IsRim": true,
|
||||||
@ -76,300 +80,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"StartTime": 8000,
|
"StartTime": 8000,
|
||||||
"Objects": [{
|
"Objects": [
|
||||||
|
{
|
||||||
"StartTime": 8000,
|
"StartTime": 8000,
|
||||||
"EndTime": 8000,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8026,
|
|
||||||
"EndTime": 8026,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8053,
|
|
||||||
"EndTime": 8053,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8080,
|
|
||||||
"EndTime": 8080,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8107,
|
|
||||||
"EndTime": 8107,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8133,
|
|
||||||
"EndTime": 8133,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8160,
|
|
||||||
"EndTime": 8160,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8187,
|
|
||||||
"EndTime": 8187,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8214,
|
|
||||||
"EndTime": 8214,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8241,
|
|
||||||
"EndTime": 8241,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8267,
|
|
||||||
"EndTime": 8267,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8294,
|
|
||||||
"EndTime": 8294,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8321,
|
|
||||||
"EndTime": 8321,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8348,
|
|
||||||
"EndTime": 8348,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8374,
|
|
||||||
"EndTime": 8374,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8401,
|
|
||||||
"EndTime": 8401,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8428,
|
|
||||||
"EndTime": 8428,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8455,
|
|
||||||
"EndTime": 8455,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8482,
|
|
||||||
"EndTime": 8482,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8508,
|
|
||||||
"EndTime": 8508,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8535,
|
|
||||||
"EndTime": 8535,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8562,
|
|
||||||
"EndTime": 8562,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8589,
|
|
||||||
"EndTime": 8589,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8615,
|
|
||||||
"EndTime": 8615,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8642,
|
|
||||||
"EndTime": 8642,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8669,
|
|
||||||
"EndTime": 8669,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8696,
|
|
||||||
"EndTime": 8696,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8723,
|
|
||||||
"EndTime": 8723,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8749,
|
|
||||||
"EndTime": 8749,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8776,
|
|
||||||
"EndTime": 8776,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8803,
|
|
||||||
"EndTime": 8803,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8830,
|
|
||||||
"EndTime": 8830,
|
|
||||||
"IsRim": false,
|
|
||||||
"IsCentre": true,
|
|
||||||
"IsDrumRoll": false,
|
|
||||||
"IsSwell": false,
|
|
||||||
"IsStrong": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"StartTime": 8857,
|
|
||||||
"EndTime": 8857,
|
"EndTime": 8857,
|
||||||
"IsRim": false,
|
"IsRim": false,
|
||||||
"IsCentre": true,
|
"IsCentre": false,
|
||||||
"IsDrumRoll": false,
|
"IsDrumRoll": true,
|
||||||
"IsSwell": false,
|
"IsSwell": false,
|
||||||
"IsStrong": false
|
"IsStrong": false
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"Mappings": [
|
||||||
|
{
|
||||||
|
"StartTime": 51532,
|
||||||
|
"Objects": [
|
||||||
|
{
|
||||||
|
"StartTime": 51532,
|
||||||
|
"EndTime": 52301,
|
||||||
|
"IsRim": false,
|
||||||
|
"IsCentre": false,
|
||||||
|
"IsDrumRoll": true,
|
||||||
|
"IsSwell": false,
|
||||||
|
"IsStrong": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
osu file format v14
|
||||||
|
|
||||||
|
[General]
|
||||||
|
Mode: 0
|
||||||
|
|
||||||
|
[Difficulty]
|
||||||
|
HPDrainRate:2
|
||||||
|
CircleSize:3.2
|
||||||
|
OverallDifficulty:2
|
||||||
|
ApproachRate:3
|
||||||
|
SliderMultiplier:0.999999999999999
|
||||||
|
SliderTickRate:1
|
||||||
|
|
||||||
|
[TimingPoints]
|
||||||
|
763,384.615384615385,4,2,0,70,1,0
|
||||||
|
49993,-90.9090909090909,4,2,0,75,0,1
|
||||||
|
|
||||||
|
[HitObjects]
|
||||||
|
51,245,51532,2,0,P|18:150|17:122,2,110.000003356934,0|8|0,0:0|0:0|0:0,0:0:0:0:
|
@ -260,17 +260,10 @@ namespace osu.Game.Beatmaps
|
|||||||
}
|
}
|
||||||
catch (BeatmapInvalidForRulesetException e)
|
catch (BeatmapInvalidForRulesetException e)
|
||||||
{
|
{
|
||||||
// Conversion has failed for the given ruleset, so return the difficulty in the beatmap's default ruleset.
|
|
||||||
|
|
||||||
// Ensure the beatmap's default ruleset isn't the one already being converted to.
|
|
||||||
// This shouldn't happen as it means something went seriously wrong, but if it does an endless loop should be avoided.
|
|
||||||
if (rulesetInfo.Equals(beatmapInfo.Ruleset))
|
if (rulesetInfo.Equals(beatmapInfo.Ruleset))
|
||||||
{
|
|
||||||
Logger.Error(e, $"Failed to convert {beatmapInfo.OnlineBeatmapID} to the beatmap's default ruleset ({beatmapInfo.Ruleset}).");
|
Logger.Error(e, $"Failed to convert {beatmapInfo.OnlineBeatmapID} to the beatmap's default ruleset ({beatmapInfo.Ruleset}).");
|
||||||
return new StarDifficulty();
|
|
||||||
}
|
|
||||||
|
|
||||||
return GetAsync(new DifficultyCacheLookup(key.Beatmap, key.Beatmap.Ruleset, key.OrderedMods)).Result;
|
return new StarDifficulty();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -164,12 +164,13 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
/// Legacy BPM multiplier that introduces floating-point errors for rulesets that depend on it.
|
/// Legacy BPM multiplier that introduces floating-point errors for rulesets that depend on it.
|
||||||
/// DO NOT USE THIS UNLESS 100% SURE.
|
/// DO NOT USE THIS UNLESS 100% SURE.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float BpmMultiplier { get; private set; }
|
public double BpmMultiplier { get; private set; }
|
||||||
|
|
||||||
public LegacyDifficultyControlPoint(double beatLength)
|
public LegacyDifficultyControlPoint(double beatLength)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
BpmMultiplier = beatLength < 0 ? Math.Clamp((float)-beatLength, 10, 10000) / 100f : 1;
|
// Note: In stable, the division occurs on floats, but with compiler optimisations turned on actually seems to occur on doubles via some .NET black magic (possibly inlining?).
|
||||||
|
BpmMultiplier = beatLength < 0 ? Math.Clamp((float)-beatLength, 10, 10000) / 100.0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LegacyDifficultyControlPoint()
|
public LegacyDifficultyControlPoint()
|
||||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
TooltipText = "Downloading...";
|
TooltipText = "Downloading...";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DownloadState.Downloaded:
|
case DownloadState.Importing:
|
||||||
background.FadeColour(colours.Yellow, 500, Easing.InOutExpo);
|
background.FadeColour(colours.Yellow, 500, Easing.InOutExpo);
|
||||||
TooltipText = "Importing";
|
TooltipText = "Importing";
|
||||||
break;
|
break;
|
||||||
|
@ -7,7 +7,7 @@ namespace osu.Game.Online
|
|||||||
{
|
{
|
||||||
NotDownloaded,
|
NotDownloaded,
|
||||||
Downloading,
|
Downloading,
|
||||||
Downloaded,
|
Importing,
|
||||||
LocallyAvailable
|
LocallyAvailable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ namespace osu.Game.Online
|
|||||||
{
|
{
|
||||||
if (attachedRequest.Progress == 1)
|
if (attachedRequest.Progress == 1)
|
||||||
{
|
{
|
||||||
State.Value = DownloadState.Downloaded;
|
State.Value = DownloadState.Importing;
|
||||||
Progress.Value = 1;
|
Progress.Value = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -125,7 +125,7 @@ namespace osu.Game.Online
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onRequestSuccess(string _) => Schedule(() => State.Value = DownloadState.Downloaded);
|
private void onRequestSuccess(string _) => Schedule(() => State.Value = DownloadState.Importing);
|
||||||
|
|
||||||
private void onRequestProgress(float progress) => Schedule(() => Progress.Value = progress);
|
private void onRequestProgress(float progress) => Schedule(() => Progress.Value = progress);
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using osu.Game.Online.Rooms;
|
||||||
|
|
||||||
namespace osu.Game.Online.Multiplayer
|
namespace osu.Game.Online.Multiplayer
|
||||||
{
|
{
|
||||||
@ -47,6 +48,13 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
/// <param name="state">The new state of the user.</param>
|
/// <param name="state">The new state of the user.</param>
|
||||||
Task UserStateChanged(int userId, MultiplayerUserState state);
|
Task UserStateChanged(int userId, MultiplayerUserState state);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Signals that a user in this room changed their beatmap availability state.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId">The ID of the user whose beatmap availability state has changed.</param>
|
||||||
|
/// <param name="beatmapAvailability">The new beatmap availability state of the user.</param>
|
||||||
|
Task UserBeatmapAvailabilityChanged(int userId, BeatmapAvailability beatmapAvailability);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Signals that a match is to be started. This will *only* be sent to clients which are to begin loading at this point.
|
/// Signals that a match is to be started. This will *only* be sent to clients which are to begin loading at this point.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using osu.Game.Online.Rooms;
|
||||||
|
|
||||||
namespace osu.Game.Online.Multiplayer
|
namespace osu.Game.Online.Multiplayer
|
||||||
{
|
{
|
||||||
@ -40,6 +41,12 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
|
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
|
||||||
Task ChangeState(MultiplayerUserState newState);
|
Task ChangeState(MultiplayerUserState newState);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Change the local user's availability state of the current beatmap set in joined room.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newBeatmapAvailability">The proposed new beatmap availability state.</param>
|
||||||
|
Task ChangeBeatmapAvailability(BeatmapAvailability newBeatmapAvailability);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// As the host of a room, start the match.
|
/// As the host of a room, start the match.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -14,6 +14,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
|
using osu.Game.Online.Rooms;
|
||||||
|
|
||||||
namespace osu.Game.Online.Multiplayer
|
namespace osu.Game.Online.Multiplayer
|
||||||
{
|
{
|
||||||
@ -173,6 +174,14 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
return connection.InvokeAsync(nameof(IMultiplayerServer.ChangeState), newState);
|
return connection.InvokeAsync(nameof(IMultiplayerServer.ChangeState), newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override Task ChangeBeatmapAvailability(BeatmapAvailability newBeatmapAvailability)
|
||||||
|
{
|
||||||
|
if (!isConnected.Value)
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
|
return connection.InvokeAsync(nameof(IMultiplayerServer.ChangeBeatmapAvailability), newBeatmapAvailability);
|
||||||
|
}
|
||||||
|
|
||||||
public override Task StartMatch()
|
public override Task StartMatch()
|
||||||
{
|
{
|
||||||
if (!isConnected.Value)
|
if (!isConnected.Value)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Online.Multiplayer
|
namespace osu.Game.Online.Multiplayer
|
||||||
@ -16,6 +17,11 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
|
|
||||||
public MultiplayerUserState State { get; set; } = MultiplayerUserState.Idle;
|
public MultiplayerUserState State { get; set; } = MultiplayerUserState.Idle;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The availability state of the current beatmap.
|
||||||
|
/// </summary>
|
||||||
|
public BeatmapAvailability BeatmapAvailability { get; set; } = BeatmapAvailability.LocallyAvailable();
|
||||||
|
|
||||||
public User? User { get; set; }
|
public User? User { get; set; }
|
||||||
|
|
||||||
[JsonConstructor]
|
[JsonConstructor]
|
||||||
|
@ -227,6 +227,8 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
|
|
||||||
public abstract Task ChangeState(MultiplayerUserState newState);
|
public abstract Task ChangeState(MultiplayerUserState newState);
|
||||||
|
|
||||||
|
public abstract Task ChangeBeatmapAvailability(BeatmapAvailability newBeatmapAvailability);
|
||||||
|
|
||||||
public abstract Task StartMatch();
|
public abstract Task StartMatch();
|
||||||
|
|
||||||
Task IMultiplayerClient.RoomStateChanged(MultiplayerRoomState state)
|
Task IMultiplayerClient.RoomStateChanged(MultiplayerRoomState state)
|
||||||
@ -354,6 +356,27 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Task IMultiplayerClient.UserBeatmapAvailabilityChanged(int userId, BeatmapAvailability beatmapAvailability)
|
||||||
|
{
|
||||||
|
if (Room == null)
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
|
Scheduler.Add(() =>
|
||||||
|
{
|
||||||
|
var user = Room?.Users.SingleOrDefault(u => u.UserID == userId);
|
||||||
|
|
||||||
|
// errors here are not critical - beatmap availability state is mostly for display.
|
||||||
|
if (user == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
user.BeatmapAvailability = beatmapAvailability;
|
||||||
|
|
||||||
|
RoomUpdated?.Invoke();
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
Task IMultiplayerClient.LoadRequested()
|
Task IMultiplayerClient.LoadRequested()
|
||||||
{
|
{
|
||||||
if (Room == null)
|
if (Room == null)
|
||||||
|
40
osu.Game/Online/Rooms/BeatmapAvailability.cs
Normal file
40
osu.Game/Online/Rooms/BeatmapAvailability.cs
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace osu.Game.Online.Rooms
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The local availability information about a certain beatmap for the client.
|
||||||
|
/// </summary>
|
||||||
|
public class BeatmapAvailability : IEquatable<BeatmapAvailability>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The beatmap's availability state.
|
||||||
|
/// </summary>
|
||||||
|
public readonly DownloadState State;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The beatmap's downloading progress, null when not in <see cref="DownloadState.Downloading"/> state.
|
||||||
|
/// </summary>
|
||||||
|
public readonly double? DownloadProgress;
|
||||||
|
|
||||||
|
[JsonConstructor]
|
||||||
|
private BeatmapAvailability(DownloadState state, double? downloadProgress = null)
|
||||||
|
{
|
||||||
|
State = state;
|
||||||
|
DownloadProgress = downloadProgress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BeatmapAvailability NotDownloaded() => new BeatmapAvailability(DownloadState.NotDownloaded);
|
||||||
|
public static BeatmapAvailability Downloading(double progress) => new BeatmapAvailability(DownloadState.Downloading, progress);
|
||||||
|
public static BeatmapAvailability Importing() => new BeatmapAvailability(DownloadState.Importing);
|
||||||
|
public static BeatmapAvailability LocallyAvailable() => new BeatmapAvailability(DownloadState.LocallyAvailable);
|
||||||
|
|
||||||
|
public bool Equals(BeatmapAvailability other) => other != null && State == other.State && DownloadProgress == other.DownloadProgress;
|
||||||
|
|
||||||
|
public override string ToString() => $"{string.Join(", ", State, $"{DownloadProgress:0.00%}")}";
|
||||||
|
}
|
||||||
|
}
|
@ -57,7 +57,7 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
|||||||
switch (State.Value)
|
switch (State.Value)
|
||||||
{
|
{
|
||||||
case DownloadState.Downloading:
|
case DownloadState.Downloading:
|
||||||
case DownloadState.Downloaded:
|
case DownloadState.Importing:
|
||||||
shakeContainer.Shake();
|
shakeContainer.Shake();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
|||||||
progressBar.ResizeHeightTo(4, 400, Easing.OutQuint);
|
progressBar.ResizeHeightTo(4, 400, Easing.OutQuint);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DownloadState.Downloaded:
|
case DownloadState.Importing:
|
||||||
progressBar.FadeIn(400, Easing.OutQuint);
|
progressBar.FadeIn(400, Easing.OutQuint);
|
||||||
progressBar.ResizeHeightTo(4, 400, Easing.OutQuint);
|
progressBar.ResizeHeightTo(4, 400, Easing.OutQuint);
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DownloadState.Downloaded:
|
case DownloadState.Importing:
|
||||||
textSprites.Children = new Drawable[]
|
textSprites.Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
|
@ -287,7 +287,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DownloadState.Downloading:
|
case DownloadState.Downloading:
|
||||||
case DownloadState.Downloaded:
|
case DownloadState.Importing:
|
||||||
// temporary to avoid showing two buttons for maps with novideo. will be fixed in new beatmap overlay design.
|
// temporary to avoid showing two buttons for maps with novideo. will be fixed in new beatmap overlay design.
|
||||||
downloadButtonsContainer.Child = new HeaderDownloadButton(BeatmapSet.Value);
|
downloadButtonsContainer.Child = new HeaderDownloadButton(BeatmapSet.Value);
|
||||||
break;
|
break;
|
||||||
|
@ -37,6 +37,8 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
{
|
{
|
||||||
JudgementText = new OsuSpriteText
|
JudgementText = new OsuSpriteText
|
||||||
{
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
Text = Result.GetDescription().ToUpperInvariant(),
|
Text = Result.GetDescription().ToUpperInvariant(),
|
||||||
Colour = colours.ForHitResult(Result),
|
Colour = colours.ForHitResult(Result),
|
||||||
Font = OsuFont.Numeric.With(size: 20),
|
Font = OsuFont.Numeric.With(size: 20),
|
||||||
|
@ -241,8 +241,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
|
|
||||||
void endOperation()
|
void endOperation()
|
||||||
{
|
{
|
||||||
Debug.Assert(readyClickOperation != null);
|
readyClickOperation?.Dispose();
|
||||||
readyClickOperation.Dispose();
|
|
||||||
readyClickOperation = null;
|
readyClickOperation = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -255,9 +254,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
|
|
||||||
StartPlay(() => new MultiplayerPlayer(SelectedItem.Value, userIds));
|
StartPlay(() => new MultiplayerPlayer(SelectedItem.Value, userIds));
|
||||||
|
|
||||||
Debug.Assert(readyClickOperation != null);
|
readyClickOperation?.Dispose();
|
||||||
|
|
||||||
readyClickOperation.Dispose();
|
|
||||||
readyClickOperation = null;
|
readyClickOperation = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
scores.Download(Model.Value);
|
scores.Download(Model.Value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DownloadState.Downloaded:
|
case DownloadState.Importing:
|
||||||
case DownloadState.Downloading:
|
case DownloadState.Downloading:
|
||||||
shakeContainer.Shake();
|
shakeContainer.Shake();
|
||||||
break;
|
break;
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Multiplayer
|
namespace osu.Game.Tests.Visual.Multiplayer
|
||||||
@ -77,6 +78,13 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ChangeUserBeatmapAvailability(int userId, BeatmapAvailability newBeatmapAvailability)
|
||||||
|
{
|
||||||
|
Debug.Assert(Room != null);
|
||||||
|
|
||||||
|
((IMultiplayerClient)this).UserBeatmapAvailabilityChanged(userId, newBeatmapAvailability);
|
||||||
|
}
|
||||||
|
|
||||||
protected override Task<MultiplayerRoom> JoinRoom(long roomId)
|
protected override Task<MultiplayerRoom> JoinRoom(long roomId)
|
||||||
{
|
{
|
||||||
var user = new MultiplayerRoomUser(api.LocalUser.Value.Id) { User = api.LocalUser.Value };
|
var user = new MultiplayerRoomUser(api.LocalUser.Value.Id) { User = api.LocalUser.Value };
|
||||||
@ -108,6 +116,12 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override Task ChangeBeatmapAvailability(BeatmapAvailability newBeatmapAvailability)
|
||||||
|
{
|
||||||
|
ChangeUserBeatmapAvailability(api.LocalUser.Value.Id, newBeatmapAvailability);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
public override Task StartMatch()
|
public override Task StartMatch()
|
||||||
{
|
{
|
||||||
Debug.Assert(Room != null);
|
Debug.Assert(Room != null);
|
||||||
|
Reference in New Issue
Block a user