Skip to content
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

Populate noteParams and score fields when decoding notes. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ReplayDecoder/Replay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -832,11 +832,13 @@ private async Task<NoteEvent> DecodeNote(Stream stream)
{
NoteEvent result = new NoteEvent();
result.noteID = await DecodeInt(stream);
result.noteParams = new NoteParams(result.noteID);
result.eventTime = await DecodeFloat(stream);
result.spawnTime = await DecodeFloat(stream);
result.eventType = (NoteEventType) await DecodeInt(stream);
if (result.eventType == NoteEventType.good || result.eventType == NoteEventType.bad) {
result.noteCutInfo = await DecodeCutInfo(stream);
result.score = NoteScore.CalculateNoteScore(result.noteCutInfo, result.noteParams.scoringType);
}

if (result.noteID == -1 || (result.noteID > 0 && result.noteID < 100000 && result.noteID % 10 == 9)) {
Expand Down Expand Up @@ -1141,11 +1143,13 @@ private static NoteEvent DecodeNote(byte[] buffer, ref int pointer)
{
NoteEvent result = new NoteEvent();
result.noteID = DecodeInt(buffer, ref pointer);
result.noteParams = new NoteParams(result.noteID);
result.eventTime = DecodeFloat(buffer, ref pointer);
result.spawnTime = DecodeFloat(buffer, ref pointer);
result.eventType = (NoteEventType)DecodeInt(buffer, ref pointer);
if (result.eventType == NoteEventType.good || result.eventType == NoteEventType.bad) {
result.noteCutInfo = DecodeCutInfo(buffer, ref pointer);
result.score = NoteScore.CalculateNoteScore(result.noteCutInfo, result.noteParams.scoringType);
}

if (result.noteID == -1 || (result.noteID > 0 && result.noteID < 100000 && result.noteID % 10 == 9)) {
Expand Down