public override async Task <LeaveGroupResult> LeaveGroup(LeaveGroupAttempt request, ServerCallContext context) { var result = new LeaveGroupResult(); Player player; 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(() => { var group = player.group; if (group != null) { group.RemoveQualifiedMember(player); if (player.arena_state == ArenaState.Queued) { match_maker.RemovePlayer(player); } } return result; })); } catch (Exception e) { Log.Exception(e); return(result); } }
private static void on_leave_group(LeaveGroupResult r) { group = null; }