feat(upserver): 接入认证与KV存档并完成限定钓鱼闭环
This commit is contained in:
@@ -24,7 +24,7 @@ namespace EventPartnerGather
|
||||
public class PartnerInfoManager : IDisposable
|
||||
{
|
||||
// [Inject]
|
||||
private static Tables _tables { get; set; } = GContext.container.Resolve<Tables>();
|
||||
private readonly Tables _tables = GContext.container.Resolve<Tables>();
|
||||
private FriendService _friendService { get; set; } = GContext.container.Resolve<FriendService>();
|
||||
private IUserService _userService { get; } = GContext.container.Resolve<IUserService>();
|
||||
|
||||
@@ -41,9 +41,15 @@ namespace EventPartnerGather
|
||||
public int EventId { get; set; }
|
||||
|
||||
//
|
||||
public static readonly int BuilderCapacity = _tables.TbEventPartnerConfig.InvitationCount[1];
|
||||
// D4: current-context read. Unlike the old field, this is not frozen across configuration changes.
|
||||
public static int BuilderCapacity => GContext.container.Resolve<Tables>().TbEventPartnerConfig.InvitationCount[1];
|
||||
|
||||
public readonly BuildPartner[] BuildPartners = new BuildPartner[BuilderCapacity];
|
||||
public readonly BuildPartner[] BuildPartners;
|
||||
public PartnerInfoManager()
|
||||
{
|
||||
BuildPartners = new BuildPartner[_tables.TbEventPartnerConfig.InvitationCount[1]];
|
||||
}
|
||||
internal bool HasSubscriptionsForKVLoad => disposables != null;
|
||||
//
|
||||
public bool IsFullyMatched => BuildPartners.All(b => b != null && b.IsValid());
|
||||
|
||||
@@ -387,9 +393,9 @@ namespace EventPartnerGather
|
||||
public bool AddBuildPartner(BuildPartner buildPartner)
|
||||
{
|
||||
var index = buildPartner.SlotId;
|
||||
if (index >= BuilderCapacity)
|
||||
if (index >= BuildPartners.Length)
|
||||
{
|
||||
LogWarning($"AddBuildPartnerFailed eventId={EventId} reason=SlotOutOfRange slotId={index} capacity={BuilderCapacity}");
|
||||
LogWarning($"AddBuildPartnerFailed eventId={EventId} reason=SlotOutOfRange slotId={index} capacity={BuildPartners.Length}");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -475,4 +481,4 @@ namespace EventPartnerGather
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user