private static void on_unignored_player(BasicPlayerInfo player, UnIgnorePlayerResult r) { if (!r.IsIgnored) { if (!BasicPlayerInfoOps.RemoveOne(ignored, player)) { Debug.LogError("Server said to us player is ignored but according to the data store the player was never ignored!"); } } }
public override async Task <UnIgnorePlayerResult> UnIgnorePlayer(UnIgnorePlayerAttempt request, ServerCallContext context) { var result = new UnIgnorePlayerResult { IsIgnored = true }; Player player; var target_permanent_id = request.PlayerId; try { player = auth.GetPlayer(context); if (player == null) { return(result); } } catch (Exception e) { Log.Exception(e); return(result); } try { return(await in_memory_worker.Schedule(() => { if (!player.RemoveIgnoredPlayer(target_permanent_id)) { result.IsIgnored = false; } else { result.IsIgnored = true; } return result; })); } catch (Exception e) { Log.Exception(e); return(result); } }