A rhythm game net ranking service built on ATproto.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

okay I think this might not actually be my fault now

LemmaEOF 3ee53414 be01030f

+24
+24
game-example/fishyflip/FishyFlipHandler.cs
··· 35 35 BrowserResult result = await browser.InvokeAsync(url); 36 36 if (result.IsError) { 37 37 GD.PrintErr($"Error while authenticating: {error}"); 38 + return; 38 39 } 39 40 GD.Print(result.Response); 40 41 (Session sess, error) = await proto.AuthenticateWithOAuth2CallbackResultAsync($"{browser.RedirectUri}?{result.Response}"); 42 + if (sess == null) { 43 + GD.PrintErr("Error getting session - session is null"); 44 + return; 45 + } 41 46 if (error != null) { 42 47 GD.PrintErr($"Error while getting session: {error}"); 43 48 return; 44 49 } 45 50 (session, error) = await proto.RefreshAuthSessionResultAsync(); 51 + if (sess == null) { 52 + GD.PrintErr("Error while refreshing - session is null"); 53 + return; 54 + } 46 55 if (error != null) { 47 56 GD.PrintErr($"Error while refreshing: {error}"); 48 57 return; 49 58 } 50 59 SaveSession(); 51 60 authorized = true; 61 + GD.Print($"Token: {session.Session.AccessJwt}, refresh: {session.Session.RefreshJwt}, proof: {session.ProofKey}"); 52 62 EmitSignal(TsunagiteHandler.SignalName.AuthComplete, true); 53 63 } 54 64 ··· 62 72 return; 63 73 } 64 74 proto = GenerateProtocol(); 75 + GD.Print("Starting to reauthorize"); 65 76 (Session sess, ATError error) = await proto.AuthenticateWithOAuth2SessionResultAsync(session, "https://lemmaeof.gay/oauth-client-metadata.json"); 77 + if (sess == null) { 78 + GD.PrintErr("Error getting session - session is null"); 79 + return; 80 + } 66 81 if (error != null) { 67 82 GD.PrintErr($"Error while getting session: {error}"); 68 83 return; 69 84 } 85 + GD.Print("Refreshing session"); 70 86 (session, error) = await proto.RefreshAuthSessionResultAsync(); 87 + if (sess == null) { 88 + GD.PrintErr("Error while refreshing - session is null"); 89 + return; 90 + } 71 91 if (error != null) { 72 92 GD.PrintErr($"Error while refreshing: {error}"); 73 93 return; ··· 78 98 } 79 99 80 100 public override async Task<string> SubmitScore(TsunagiteScore score) { 101 + if (proto.Session == null || proto.AuthSession == null) { 102 + GD.PrintErr($"Proto has lost state! Session: {proto.Session}, authSession: {proto.AuthSession}"); 103 + return ""; 104 + } 81 105 ScoreWrapper wrapper = new(score); 82 106 (CreateRecordOutput res, ATError error) = await proto.CreateRecordAsync(ATIdentifier.Create(handleInfo.Did), "dev.tsunagite.score", wrapper, TimestampId.EncodeTid(score.Timestamp)); 83 107 if (res != null) {