mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 03:24:33 +08:00
Added UserName property to various Server EventArgs. (#2123)
* Added UserName property to various Server EventArgs. * InjectedMqttApplicationMessage: Add SenderUserName property. * Reformat code * Reformat code --------- Co-authored-by: christian <6939810+chkr1011@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using MQTTnet.Formatter;
|
||||
using MQTTnet.Packets;
|
||||
|
||||
@@ -56,6 +57,11 @@ namespace MQTTnet.Server
|
||||
/// </summary>
|
||||
public string UserName => _connectPacket.Username;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the password of the connected client.
|
||||
/// </summary>
|
||||
public string Password => Encoding.UTF8.GetString(_connectPacket.Password.AsSpan());
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user properties sent by the client.
|
||||
/// <remarks>MQTT 5.0.0+ feature.</remarks>
|
||||
|
||||
Reference in New Issue
Block a user