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

Rc hotfix raid #563

Merged
merged 1 commit into from
Nov 28, 2023
Merged
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
51 changes: 17 additions & 34 deletions NineChronicles.DataProvider/RenderSubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken)
typeof(RuneSheet),
typeof(RuneListSheet),
typeof(RuneOptionSheet),
typeof(WorldBossListSheet),
});

var runeSheet = sheets.GetSheet<RuneSheet>();
Expand Down Expand Up @@ -1273,40 +1274,22 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken)

_avatarList.Add(AvatarData.GetAvatarInfo(outputState, ev.Signer, ev.Action.AvatarAddress, ev.Action.RuneInfos, _blockTimeOffset));

int raidId = 0;
bool found = false;
for (int i = 0; i < 99; i++)
{
if (outputState.Delta.UpdatedAddresses.Contains(
Addresses.GetRaiderAddress(ev.Action.AvatarAddress, i)))
{
raidId = i;
found = true;
break;
}
}

if (found)
{
RaiderState raiderState =
outputState.GetRaiderState(ev.Action.AvatarAddress, raidId);
var model = new RaiderModel(
raidId,
raiderState.AvatarName,
raiderState.HighScore,
raiderState.TotalScore,
raiderState.Cp,
raiderState.IconId,
raiderState.Level,
raiderState.AvatarAddress.ToHex(),
raiderState.PurchaseCount);
_raiderList.Add(RaidData.GetRaidInfo(raidId, raiderState));
MySqlStore.StoreRaider(model);
}
else
{
Log.Error("can't find raidId.");
}
var worldBossListSheet = sheets.GetSheet<WorldBossListSheet>();
int raidId = worldBossListSheet.FindRaidIdByBlockIndex(ev.BlockIndex);
RaiderState raiderState =
outputState.GetRaiderState(ev.Action.AvatarAddress, raidId);
var model = new RaiderModel(
raidId,
raiderState.AvatarName,
raiderState.HighScore,
raiderState.TotalScore,
raiderState.Cp,
raiderState.IconId,
raiderState.Level,
raiderState.AvatarAddress.ToHex(),
raiderState.PurchaseCount);
_raiderList.Add(RaidData.GetRaidInfo(raidId, raiderState));
MySqlStore.StoreRaider(model);
}
}
catch (Exception e)
Expand Down
Loading