コード例 #1
0
    public object GetUpdateFor(string clientId)
    {
        var client  = _connectedClients.Find(clientId);
        var clients = _connectedClients.FindInGroups(client !.Groups);

        var progresses = _state.GetProgressesForSession(client.Group)
                         .Where(c => c.Key != clientId && clients.Select(x => x.ClientId).Contains(c.Key))
                         .Select(x => new Typed
        {
            ClientId             = x.Key,
            TypedCharactersCount = x.Value
        });

        return(new Update
        {
            Progresses = progresses.ToList()
        });
    }
コード例 #2
0
 // HACK: Temporary hack.
 public IEnumerable <Typed> GetClientProgresses(string typingSessionId) => _state.GetProgressesForSession(typingSessionId).Select(x => new Typed
 {
     ClientId             = x.Key,
     TypedCharactersCount = x.Value
 });