1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

[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

View file

@ -11,6 +11,7 @@ using Nibriboard.RippleSpace;
using SBRL.GlidingSquirrel.Websocket; using SBRL.GlidingSquirrel.Websocket;
using System.Net; using System.Net;
using Nibriboard.Userspace;
namespace Nibriboard.Client namespace Nibriboard.Client
{ {
@ -76,6 +77,20 @@ namespace Nibriboard.Client
return connection.RemoteEndpoint; 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> /// <summary>
/// Fires when this nibri client disconnects. /// Fires when this nibri client disconnects.
/// </summary> /// </summary>