ServerBytes Server SDK contains a few services which can be overriden by plugins.

These are:

  • IAuthService
  • IUserService

IAuthService methods

GetPrincipal

Gets the IPrincipal of the current user, or a default non-authorized principal if the current user is not logged in.

IPrincipal GetPrincipal();

IUserService methods

GetNumberOfUsers

Gets the number of currently connected users.

int GetNumberOfUsers();

GetUser

Gets the user by UserId.

Task<User> GetUser(UserId userId);

GetUsers

Gets multiple users by UserId.

Task<IReadOnlyCollection<User>> GetUsers(List<UserId> userIds);

GetUser

Gets the user by SessionId.

Task<User> GetUser(SessionId sessionId);

GetUsers

Gets multiple users by SessionId.

Task<IReadOnlyCollection<User>> GetUsers(List<SessionId> sessionIds);

FindUsersByDisplayName

Searches for users where display name contains argument value.

Task<IReadOnlyCollection<User>> FindUsersByDisplayName(string displayName, int skip, int take);

public class User

Properties

Type Name Description
UserId UserId Id of the user. Valid only if the user exists
SessionId SessionId SessionId of the user. Valid only if user is online
bool IsOnline True if the user is online
bool Exists True if the user exists
string DisplayName Display name of the user. Valid only if the user exists

results matching ""

    No results matching ""