feat(upserver): 接入认证与KV存档并完成限定钓鱼闭环

This commit is contained in:
Liubing\LB
2026-09-28 18:14:01 +08:00
parent f40a816cc4
commit 0eb43b2b40
129 changed files with 11612 additions and 573 deletions

View File

@@ -0,0 +1,31 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace game.PlayerDataStorage
{
public enum PlayerKVError
{
None, Validation, Unauthorized, Http, Network, Timeout, Cancelled, Protocol
}
public sealed class PlayerKVResult
{
public bool Success => Error == PlayerKVError.None;
public PlayerKVError Error { get; }
public int? StatusCode { get; }
// Only a successful Get has Data. Failure must never look like an empty save.
public IReadOnlyDictionary<string, string> Data { get; }
// A failed write that entered the transport may already have reached the server.
// This is conservative, including HTTP failures. Do not blindly replay the write.
public bool MayHaveCommitted { get; }
internal PlayerKVResult(PlayerKVError error, int? statusCode = null,
Dictionary<string, string> data = null, bool mayHaveCommitted = false)
{
Error = error;
StatusCode = statusCode;
Data = data == null ? null : new ReadOnlyDictionary<string, string>(data);
MayHaveCommitted = mayHaveCommitted;
}
}
}