-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
level.Options.Ka1 does not give AudioTrack #38
Comments
I've tried to reproduce the example on the v0.2.29 [TestFixture]
public class LevelTests
{
[Test]
public void AudioTrack()
{
var level = new Level();
level.Options.Ka1 = 10;
var result = level.SaveAsString(compress: false);
result.Should().Contain("kA1,10");
level = new Level(result.Replace("kA1,10", "kA1,111"), compressed: false);
level.Options.Ka1.Should().Be(111);
}
} So I want to ask a couple of questions. Which framework are you using? .NET Framework or .NET (Core) The reason I'm asking the last question is because [TestFixture]
public class LevelTests
{
[Test]
public async Task AudioTrack()
{
// for online levels
var client = new GameClient();
var response = await client.SearchLevelsAsync(new Server.Queries.GetLevelsQuery(Server.Enums.SearchType.Featured));
var page = response.GetResultOrDefault();
var levelInfo = page.Levels.FirstOrDefault();
if (levelInfo.MusicId > 0)
{
// retrieve additional info of custom track
var track = page.Musics.FirstOrDefault(x => x.MusicId == levelInfo.MusicId);
}
else
{
var officialAudioTrack = levelInfo.OfficialSong;
}
// for "my levels" page
var local = await LocalLevels.LoadFileAsync();
var localLevel = local.First();
var musicId = localLevel.MusicId;
var customMusic = localLevel.CustomMusic; // indicates that official or custom
}
} In addition, these methods allow you to get an audio track without loading the entire level into memory. Footnotes
|
The way you showed me using My .NET version is I created a level and made it use the song id var localLevels = await LocalLevels.LoadFileAsync();
var level = localLevels.GetLevel("<level name>");
var loadedLevel = level.LoadLevel();
var songID = loadedLevel.Options.Ka1;
Console.WriteLine(songID); // Is 0, not 123 |
Looks like the game doesn't use var localLevels = await LocalLevels.LoadFileAsync();
var level = localLevels.GetLevel("<level name>");
var songID = level.MusicId;
Console.WriteLine(songID); // should be 123 You can check for yourself whether the game set |
I am downloading a level from the servers and saving it into a text file (not encrypted) and later in my program I want to read the level from the text file and get the song id. I could use |
I think in that case you can save metadata about level. |
Describe the bug
When accessing
Ka1
onLevelOptions
it always returns0
To Reproduce
Steps to reproduce the behavior:
Ka1
onLevelOptions
0
Expected behavior
It should return the AudioTrack instead of
0
https://wyliemaster.github.io/gddocs/#/resources/client/level-components/level-start
The text was updated successfully, but these errors were encountered: