コード例 #1
0
        private void AddWebClientToRoom(WebClientActionJoin webClientActionJoin, IWebSocketConnection connection)
        {
            var room = _socketRooms.FirstOrDefault(x => x.ConnectedClients.Any(client => client.RfIdCardNumber == webClientActionJoin.RfIdCardNo));

            if (room == null)
            {
                room = new SocketRoom();
            }

            var newClient = new BrowserSocketClient(room, connection, webClientActionJoin.RfIdCardNo);

            room.AddClient(newClient);

            _joinedClients.TryAdd(connection, newClient);
        }
コード例 #2
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (messageCase_ == MessageOneofCase.WebClientActionJoin)
        {
            hash ^= WebClientActionJoin.GetHashCode();
        }
        hash ^= (int)messageCase_;
        if (_unknownFields != null)
        {
            hash ^= _unknownFields.GetHashCode();
        }
        return(hash);
    }
コード例 #3
0
    public void MergeFrom(WebClientAction other)
    {
        if (other == null)
        {
            return;
        }
        switch (other.MessageCase)
        {
        case MessageOneofCase.WebClientActionJoin:
            if (WebClientActionJoin == null)
            {
                WebClientActionJoin = new global::WebClientActionJoin();
            }
            WebClientActionJoin.MergeFrom(other.WebClientActionJoin);
            break;
        }

        _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
    }