1
0
Fork 0

[server] Add ConnectedUser to NibriClient in preparationf or next stage (but it's untested)

This commit is contained in:
Starbeamrainbowlabs 2018-01-10 12:35:57 +00:00
parent 40d9c121e4
commit 74e289e78b
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 15 additions and 0 deletions

View File

@ -11,6 +11,7 @@ using Nibriboard.RippleSpace;
using SBRL.GlidingSquirrel.Websocket;
using System.Net;
using Nibriboard.Userspace;
namespace Nibriboard.Client
{
@ -76,6 +77,20 @@ namespace Nibriboard.Client
return connection.RemoteEndpoint;
}
}
/// <summary>
/// The user account of the currently connected client.
/// </summary>
public User ConnectedUser {
get {
if (connection.HandshakeRequest.BasicAuthCredentials == null)
return null;
return manager.NibriServer.AccountManager.GetByName(
connection.HandshakeRequest.BasicAuthCredentials.Username
);
}
}
/// <summary>
/// Fires when this nibri client disconnects.
/// </summary>