Show / Hide Table of Contents

Class Account

The account class represents a player's server account.

Inheritance
Object
Account
Implements
IAclObject
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Slipe.Server.Accounts
Assembly: SlipeServer.dll
Syntax
public sealed class Account : IAclObject

Constructors

| Improve this Doc View Source

Account(String, String, Boolean)

This function adds an account to the list of registered accounts of the current server.

Declaration
public Account(string name, string password, bool caseSensitive = false)
Parameters
Type Name Description
String name
String password
Boolean caseSensitive

Properties

| Improve this Doc View Source

AclIdentifier

Returns the identifiable string user.{name}

Declaration
public string AclIdentifier { get; }
Property Value
Type Description
String
| Improve this Doc View Source

All

Returns an array of all existing accounts

Declaration
public static Account[] All { get; }
Property Value
Type Description
Account[]
| Improve this Doc View Source

Data

Returns a dictionary of all the data stored in this account

Declaration
public Dictionary<string, string> Data { get; }
Property Value
Type Description
Dictionary<String, String>
| Improve this Doc View Source

Id

Get the ID of the account

Declaration
public int Id { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Ip

Get the IP of the account

Declaration
public string Ip { get; }
Property Value
Type Description
String
| Improve this Doc View Source

IsGuestAccount

This function checks to see if an account is a guest account.

Declaration
public bool IsGuestAccount { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

Name

Get the username of this account

Declaration
public string Name { get; }
Property Value
Type Description
String
| Improve this Doc View Source

Player

Get the player currently playing on this account if any

Declaration
public Player Player { get; }
Property Value
Type Description
Player
| Improve this Doc View Source

Serial

Get the serial of this account

Declaration
public string Serial { get; }
Property Value
Type Description
String

Methods

| Improve this Doc View Source

ClearData(String)

This function removes data under a specific key

Declaration
public bool ClearData(string key)
Parameters
Type Name Description
String key
Returns
Type Description
Boolean
| Improve this Doc View Source

CopyFrom(Account)

This function copies all of the data from one account to this account

Declaration
public bool CopyFrom(Account fromAccount)
Parameters
Type Name Description
Account fromAccount
Returns
Type Description
Boolean
| Improve this Doc View Source

Get(Int32)

Get an account from an account ID

Declaration
public static Account Get(int ID)
Parameters
Type Name Description
Int32 ID
Returns
Type Description
Account
| Improve this Doc View Source

Get(String, String, Boolean)

Get an account from some credentials

Declaration
public static Account Get(string username, string password = null, bool caseSensitive = true)
Parameters
Type Name Description
String username
String password
Boolean caseSensitive
Returns
Type Description
Account
| Improve this Doc View Source

GetAccountsByData(String, String)

Returns an array containing all accounts with specified dataName and value (

Declaration
public static Account[] GetAccountsByData(string key, string value)
Parameters
Type Name Description
String key
String value
Returns
Type Description
Account[]
| Improve this Doc View Source

GetAccountsByIP(String)

Returns an array containing all accounts that were logged onto from specified IP-address.

Declaration
public static Account[] GetAccountsByIP(string ip)
Parameters
Type Name Description
String ip
Returns
Type Description
Account[]
| Improve this Doc View Source

GetAccountsBySerial(String)

Returns an array of all accounts that were logged onto from a serial

Declaration
public static Account[] GetAccountsBySerial(string serial)
Parameters
Type Name Description
String serial
Returns
Type Description
Account[]
| Improve this Doc View Source

GetData(String)

This function retrieves a string that has been stored using SetData.

Declaration
public string GetData(string key)
Parameters
Type Name Description
String key
Returns
Type Description
String
| Improve this Doc View Source

HasPermissionTo(String, Boolean)

Check if the object has access to a given action

Declaration
public bool HasPermissionTo(string action, bool defaultPermission = true)
Parameters
Type Name Description
String action
Boolean defaultPermission
Returns
Type Description
Boolean
| Improve this Doc View Source

IsInACLGroup(AclGroup)

Check if the object is in a certain ACL group

Declaration
public bool IsInACLGroup(AclGroup group)
Parameters
Type Name Description
AclGroup group
Returns
Type Description
Boolean
| Improve this Doc View Source

Remove()

Removes this account from the server

Declaration
public bool Remove()
Returns
Type Description
Boolean
| Improve this Doc View Source

SetData(String, String)

This function sets a string to be stored in an account.

Declaration
public bool SetData(string key, string value)
Parameters
Type Name Description
String key
String value
Returns
Type Description
Boolean
| Improve this Doc View Source

SetName(String, Boolean)

Sets the name of an account

Declaration
public bool SetName(string name, bool caseSensitive = false)
Parameters
Type Name Description
String name
Boolean caseSensitive
Returns
Type Description
Boolean
| Improve this Doc View Source

SetPassword(String)

Used to set the password of this account, encrypted with sha256

Declaration
public bool SetPassword(string value)
Parameters
Type Name Description
String value
Returns
Type Description
Boolean
| Improve this Doc View Source

TryGetData(String, out String)

This function tries to retrieve the data value and returns true if this was succesful

Declaration
public bool TryGetData(string key, out string data)
Parameters
Type Name Description
String key

The key at which data is stored

String data

The string to which to write the data to

Returns
Type Description
Boolean

True if the data was succesfully retrieved, false otherwise

Events

| Improve this Doc View Source

OnDataChange

Declaration
public static event Account.OnDataChangeHandler OnDataChange
Event Type
Type Description
Account.OnDataChangeHandler

Implements

IAclObject
  • Improve this Doc
  • View Source
Back to top Generated by DocFX