Fix party loadout loading (#1200)

Co-authored-by: Alexandru Macocian <amacocian@microsoft.com>
This commit is contained in:
2026-01-02 17:10:05 +02:00
parent 9510fdc5de
commit 2f5108fd3b
2 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ public sealed class HashingService
}
seed1 = (seed1 << 3) ^ uc;
seed2 += StringHashTable[seed1 & 0xff];
seed2 += StringHashTable[seed1 & 0xf];
hash ^= seed2 + seed1;
}
+9 -10
View File
@@ -73,16 +73,15 @@ public sealed class PartyService(
return false;
}
// TODO: Hashing is broken
//var heroBehaviorSetup = await this.gameThreadService.QueueOnGameThread(() => this.GetHeroBehaviorSetup(partyLoadout), cancellationToken);
//foreach (var heroBehaviorEntry in heroBehaviorSetup ?? [])
//{
// if (!await this.SetHeroBehavior(heroBehaviorEntry.AgentId, heroBehaviorEntry.Behavior, cancellationToken))
// {
// scopedLogger.LogWarning("Could not set hero behavior for agent {agentId} to {behavior}", heroBehaviorEntry.AgentId, heroBehaviorEntry.Behavior);
// await this.chatService.AddMessageAsync($"Cannot set party loadout. Could not set behavior {behavior} for agent {agentId}.", "Daybreak.API", Channel.Moderator, cancellationToken);
// }
//}
var heroBehaviorSetup = await this.gameThreadService.QueueOnGameThread(() => this.GetHeroBehaviorSetup(partyLoadout), cancellationToken);
foreach (var heroBehaviorEntry in heroBehaviorSetup ?? [])
{
if (!await this.SetHeroBehavior(heroBehaviorEntry.AgentId, heroBehaviorEntry.Behavior, cancellationToken))
{
scopedLogger.LogWarning("Could not set hero behavior for agent {agentId} to {behavior}", heroBehaviorEntry.AgentId, heroBehaviorEntry.Behavior);
await this.chatService.AddMessageAsync($"Cannot set party loadout. Could not set behavior {heroBehaviorEntry.Behavior} for agent {heroBehaviorEntry.AgentId}.", "Daybreak.API", Channel.Moderator, cancellationToken);
}
}
await this.chatService.AddMessageAsync("Party loadout set.", "Daybreak.API", Channel.Moderator, cancellationToken);
return true;