Client LuaCsForBarotrauma
EgsOwnershipTokenAuthenticator.cs
1 using System.Text;
2 using System.Threading.Tasks;
3 
4 namespace Barotrauma.Networking;
5 
7 {
8  public override async Task<AccountInfo> VerifyTicket(AuthenticationTicket ticket)
9  {
10  var jwtOption = JsonWebToken.Parse(Encoding.UTF8.GetString(ticket.Data.AsSpan()));
11 
12  if (!jwtOption.TryUnwrap(out var jwt)) { return AccountInfo.None; }
13  var ownershipToken = new EosInterface.Ownership.Token(jwt);
14  var accountIdOption = await ownershipToken.Verify();
15 
16  if (!accountIdOption.TryUnwrap(out var accountId)) { return AccountInfo.None; }
17  return new AccountInfo(accountId);
18  }
19 
20  public override void EndAuthSession(AccountId accountId) { /* do nothing */ }
21 }
override void EndAuthSession(AccountId accountId)
override async Task< AccountInfo > VerifyTicket(AuthenticationTicket ticket)