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:
parent
40d9c121e4
commit
74e289e78b
1 changed files with 15 additions and 0 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue